Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add octo-sts identity to help with release automation #408

Merged
merged 1 commit into from
Aug 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/chainguard/release.sts.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
issuer: https://token.actions.githubusercontent.com
subject: repo:chainguard-dev/bincapz:ref:refs/heads/main
claim_pattern:
job_workflow_ref: chainguard-dev/bincapz/.github/workflows/(version|release).yaml@.*

permissions:
contents: write
pull-requests: write
8 changes: 7 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ jobs:
egress-policy: audit
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- uses: chainguard-dev/actions/setup-gitsign@e82b4e5ae10182af72972addcb3fedf7454621c8
- name: Set up Octo-STS
uses: octo-sts/action@6177b4481c00308b3839969c3eca88c96a91775f # v1.0.0
id: octo-sts
with:
scope: chainguard-dev/bincapz
identity: release
- name: Get Version
id: get-version
run: |
Expand All @@ -31,7 +37,7 @@ jobs:
echo "VERSION=$VERSION" >> "$GITHUB_OUTPUT"
- name: Create Release
env:
GH_TOKEN: ${{ github.token }}
GH_TOKEN: ${{ steps.octo-sts.outputs.token }}
if: ${{ steps.get-version.outputs.VERSION != '' }}
run: |
VERSION=${{ steps.get-version.outputs.VERSION }}
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ jobs:
egress-policy: audit
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- uses: chainguard-dev/actions/setup-gitsign@e82b4e5ae10182af72972addcb3fedf7454621c8
- name: Set up Octo-STS
uses: octo-sts/action@6177b4481c00308b3839969c3eca88c96a91775f # v1.0.0
id: octo-sts
with:
scope: chainguard-dev/bincapz
identity: release
- name: Update Version
id: update
run: |
Expand Down Expand Up @@ -77,7 +83,7 @@ jobs:
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
- name: Create Pull Request
env:
GH_TOKEN: ${{ github.token }}
GH_TOKEN: ${{ steps.octo-sts.outputs.token }}
run: |
VERSION=${{ steps.update.outputs.VERSION }}
gh pr create -t "Update bincapz to $VERSION" -b "PR to update the version in ${{ env.VERSION_FILE }} to $VERSION" -B main
Loading