From cda2c8133715839cdebfff626cab48f76a7997eb Mon Sep 17 00:00:00 2001 From: modem7 Date: Tue, 18 Aug 2026 00:30:57 +0100 Subject: [PATCH] ci: auto-trigger update-film-data PR when content is stale Previously the scheduled content-freshness check only opened a tracking issue instructing someone to run update_film_data.py manually. Now it also dispatches the existing update-film-data.yml workflow, which runs the script and opens the PR itself (skipping if one is already open). Also assign that PR to modem7 directly, since the same GITHUB_TOKEN recursion guard that blocked autoassign.yml on issues (see #85, #87) applies to PRs opened this way too. --- .github/workflows/content-freshness.yml | 9 ++++++++- .github/workflows/update-film-data.yml | 3 ++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/content-freshness.yml b/.github/workflows/content-freshness.yml index ebd5a76..2ac9d12 100644 --- a/.github/workflows/content-freshness.yml +++ b/.github/workflows/content-freshness.yml @@ -15,6 +15,7 @@ on: permissions: contents: read issues: write + actions: write jobs: check: @@ -42,9 +43,15 @@ jobs: --title "Asciimation content is out of date" \ --label content-freshness \ --assignee modem7 \ - --body "The scheduled content-freshness check found that \`src/index.html\`'s film data no longer matches upstream (https://www.asciimation.co.nz/Blinkenlights/). Run \`python3 scripts/update_film_data.py\`, review the diff, rebuild/test the image, and open a PR. This issue will need to be closed manually once that's done - the check doesn't auto-close it, to avoid closing an issue someone is still actively working." + --body "The scheduled content-freshness check found that \`src/index.html\`'s film data no longer matches upstream (https://www.asciimation.co.nz/Blinkenlights/). The \"Update film data\" workflow has been triggered automatically to open a PR with the refresh. This issue will need to be closed manually once that PR is merged - the check doesn't auto-close it, to avoid closing an issue someone is still actively working." fi + - name: Trigger automated update PR + if: steps.freshness.outcome == 'failure' + env: + GH_TOKEN: ${{ github.token }} + run: gh workflow run update-film-data.yml --ref master + - name: Fail the job if stale if: steps.freshness.outcome == 'failure' run: exit 1 diff --git a/.github/workflows/update-film-data.yml b/.github/workflows/update-film-data.yml index 4213489..c19033f 100644 --- a/.github/workflows/update-film-data.yml +++ b/.github/workflows/update-film-data.yml @@ -52,7 +52,8 @@ jobs: gh pr create \ --title "Update asciimation film data from upstream" \ --label content-freshness \ - --body "Triggered manually via the \"Update film data\" workflow. Pulls the current film array + footer note from https://www.asciimation.co.nz/Blinkenlights/ via \`scripts/update_film_data.py\`, leaving engine code and the deliberately-excluded ads/tracking/dead-links untouched. Review the diff and let the Test workflow finish before merging." + --assignee modem7 \ + --body "Triggered via the \"Update film data\" workflow (manually, or automatically by the content-freshness check). Pulls the current film array + footer note from https://www.asciimation.co.nz/Blinkenlights/ via \`scripts/update_film_data.py\`, leaving engine code and the deliberately-excluded ads/tracking/dead-links untouched. Review the diff and let the Test workflow finish before merging." - name: Summary run: |