Skip to content

Commit

Permalink
publish-commit-bottles: use public action
Browse files Browse the repository at this point in the history
Also adds the 'attestations' permission, which will be required
in the future.

Also adds a duplicate "last ditch" step that will (hopefully)
reduce the number of hard failures we see here, requiring
manual rollback of the corresponding package upload.

Signed-off-by: William Woodruff <[email protected]>
  • Loading branch information
woodruffw committed May 7, 2024
1 parent 0fd3551 commit cd6f069
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions .github/workflows/publish-commit-bottles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ jobs:
volumes:
- /mnt:/mnt
permissions:
attestations: write # for `generate build provenance`

Check failure on line 247 in .github/workflows/publish-commit-bottles.yml

View workflow job for this annotation

GitHub Actions / workflow_syntax

unknown permission scope "attestations". all available permission scopes are "actions", "checks", "contents", "deployments", "discussions", "id-token", "issues", "packages", "pages", "pull-requests", "repository-projects", "security-events", "statuses"
id-token: write # for `generate build provenance`
contents: write # for `generate build provenance`
packages: write # for `generate build provenance`
Expand Down Expand Up @@ -335,11 +336,23 @@ jobs:
echo "head_sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
- name: generate build provenance
uses: github-early-access/generate-build-provenance@main
- name: Generate build provenance
# GitHub Attestations are still in early public access, and we've seen
# some sporadic errors when generating attestations.
# Rather than fail outright, we allow this step to fail and fall
# through to a last-ditch retry below. Longer term, we should put this
# above the 'pr-pull' step, which should be split into separate 'pull'
# and 'push to GitHub Packages' phases.
continue-on-error: true
uses: actions/attest-build-provenance@v1
with:
subject-path: '${{steps.pr-pull.outputs.bottle_path}}/*.tar.gz'


- name: Generate build provenance (last ditch)
uses: actions/attest-build-provenance@v1
with:
subject-path: '${{steps.pr-pull.outputs.bottle_path}}/*.tar.gz'

- name: Push commits
uses: Homebrew/actions/git-try-push@master
with:
Expand Down

0 comments on commit cd6f069

Please sign in to comment.