Parallelize Baseline verification #14
This file contains hidden or 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: Refresh release manifest | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: [main] | |
| paths-ignore: | |
| - reports/release-manifest-v1.json | |
| permissions: | |
| contents: write | |
| concurrency: | |
| group: release-manifest-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| refresh: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - name: Check out main | |
| uses: actions/checkout@v7 | |
| with: | |
| ref: main | |
| fetch-depth: 0 | |
| - name: Set up pinned Node.js and npm | |
| uses: ./.github/actions/setup-ross-node | |
| - name: Regenerate the exact-byte release manifest | |
| run: npm run build:release-manifest | |
| - name: Confirm only the generated report changed | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| mapfile -t changed < <(git status --short | sed -E 's/^...//') | |
| if [ "${#changed[@]}" -gt 1 ] || { | |
| [ "${#changed[@]}" -eq 1 ] && | |
| [ "${changed[0]}" != "reports/release-manifest-v1.json" ]; | |
| }; then | |
| printf 'Unexpected generated changes:\n' >&2 | |
| printf '%s\n' "${changed[@]}" >&2 | |
| exit 1 | |
| fi | |
| - name: Commit the refreshed report when needed | |
| id: commit | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| if git diff --quiet -- reports/release-manifest-v1.json; then | |
| echo "changed=false" >> "$GITHUB_OUTPUT" | |
| echo "Release manifest is already current." | |
| exit 0 | |
| fi | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git add reports/release-manifest-v1.json | |
| git commit -m "Refresh release manifest after merge" | |
| git push origin HEAD:main | |
| echo "changed=true" >> "$GITHUB_OUTPUT" | |
| - name: Summarize | |
| run: | | |
| { | |
| echo "## Release manifest refresh" | |
| echo | |
| echo "- Branch: main" | |
| echo "- Report changed: ${{ steps.commit.outputs.changed }}" | |
| echo "- PR branches are never mutated by this workflow." | |
| } >> "$GITHUB_STEP_SUMMARY" |