Skip to content

GHAR - Daily Routine #3

GHAR - Daily Routine

GHAR - Daily Routine #3

name: GHAR - Daily Routine
on:
schedule:
# Run daily at 6:00 AM CET (5:00 UTC)
- cron: '0 5 * * *'
workflow_dispatch:
# Allow manual triggering for testing
jobs:
stale-check:
uses: ./.github/workflows/core-opencode-run.yml
with:
run-name: stale-check
prompt-file: .opencode/commands/ghar-stale-check.md
timeout-minutes: 30
permissions:
# Required permissions for the job to access and modify issues/PRs
issues: write
pull-requests: write
contents: read
secrets: inherit
find-uncommented-issue:
runs-on: ubuntu-latest
outputs:
issue_number: ${{ steps.find-issue.outputs.issue_number }}
has_issue: ${{ steps.find-issue.outputs.has_issue }}
steps:
- uses: actions/checkout@v5
- name: Find uncommented issue
id: find-issue
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Get all open issues and check which ones have no comments
ISSUE_NUM=$(gh issue list --state open --json number,comments --jq '.[] | select(.comments | length == 0) | .number' | head -1)
if [ -n "$ISSUE_NUM" ]; then
echo "issue_number=$ISSUE_NUM" >> $GITHUB_OUTPUT
echo "has_issue=true" >> $GITHUB_OUTPUT
echo "Found uncommented issue: #$ISSUE_NUM"
else
echo "No uncommented issues found"
echo "has_issue=false" >> $GITHUB_OUTPUT
fi
investigate-uncommented-issue:
needs: find-uncommented-issue
if: needs.find-uncommented-issue.outputs.has_issue == 'true'
uses: ./.github/workflows/core-opencode-run.yml
with:
run-name: investigate-uncommented-issue
command: ghar-issue-investigate
prompt: ${{ needs.find-uncommented-issue.outputs.issue_number }}
timeout-minutes: 30
permissions:
# Required permissions for the job to access and modify issues/PRs
issues: write
pull-requests: write
contents: read
secrets: inherit
security-check:
uses: ./.github/workflows/core-opencode-run.yml
with:
run-name: security-check
command: ghar-security-check
permissions:
# Required permissions for security scanning and issue creation
issues: write
contents: read
security-events: read
secrets: inherit