Files
chromebrew/.github/workflows/autocheck.yml
Satadru Pramanik, DO, MPH, MEng 0c110ac89c Adjust workflows to save GH token once. (#12169)
* Adjust workflows to save GH token once.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* fixup

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* fixup

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* fixup

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* fixup

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

---------

Signed-off-by: Satadru Pramanik <satadru@gmail.com>
2025-07-10 19:57:25 +00:00

32 lines
938 B
YAML

---
name: autocheck
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
env:
GH_TOKEN: ${{ secrets.CREW_PR_TOKEN }}
permissions:
actions: write
contents: write
packages: write
pull-requests: write
repository-projects: read
jobs:
autocheck:
if: ${{ github.repository_owner == 'chromebrew' }}
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
persist-credentials: true
- name: Run required checks if necessary
run: |
for pr in $(gh pr list -s open --author app/github-actions --json number | jq '.[].number')
do
# Run check workflow if it didn't already run.
gh pr checks --required $pr || (echo "Running check workflow on PR ${pr}." ; gh workflow run Unit-Test.yml $pr)
# Add reviewers to autogenerated PRs.
gh pr edit $pr --add-reviewer chromebrew/active
done