Scheduled Polling #13603
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Scheduled Polling | |
on: | |
schedule: | |
- cron: "*/30 * * * *" | |
push: | |
paths: | |
- 'fetch/workflow_template.yaml' | |
workflow_dispatch: | |
inputs: | |
origin: | |
description: 'The entity that dispatches this event' | |
required: false | |
type: string | |
teams: | |
description: 'Comma-separated numeric team IDs to update. Default to empty, meaning updating all teams.' | |
required: false | |
type: string | |
concurrency: | |
group: polling | |
cancel-in-progress: true | |
jobs: | |
fetch-update: | |
name: Fetch updates | |
environment: Polling | |
runs-on: ubuntu-latest | |
steps: | |
- name: Log initiator | |
shell: bash | |
run: | | |
echo ::notice::This polling is started by ${{ inputs.origin }} on behalf of ${{ github.triggering_actor }} | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Auth as Github App | |
id: auth-as-github-app | |
shell: bash | |
env: | |
APP_ID: ${{ secrets.APP_ID }} | |
APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }} | |
run: bash fetch/auth.sh | |
- name: Re-Checkout | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ steps.auth-as-github-app.outputs.token }} | |
- name: Setup Python3 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
architecture: 'x64' | |
- name: Query Updates | |
shell: bash | |
env: | |
GITHUB_TOKEN: ${{ steps.auth-as-github-app.outputs.token }} | |
BILUOCHUN_TOKEN: ${{ secrets.BILUOCHUN_TOKEN }} | |
run: python3 fetch/query.py ${{ inputs.teams }} | |
- name: Commit Changes | |
shell: bash | |
run: | | |
source fetch/commit_info.sh | |
git add .github/workflows | |
git commit -m "`date -u`: create/update new build workflow(s)" || true | |
git add mods | |
git commit -m "`date -u`: trigger new build(s)" || true | |
git push |