Skip to content

Commit 69c426e

Browse files
Use public beacon OIDC tokens for all repo types
Signed-off-by: Landon Grindheim <landon.grindheim@gmail.com>
1 parent a251c01 commit 69c426e

File tree

2 files changed

+5
-20
lines changed

2 files changed

+5
-20
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,7 @@ jobs:
166166
- setup-oidc
167167
runs-on: ubuntu-latest
168168
name: Smoketest
169-
permissions:
170-
id-token: write
169+
permissions: {}
171170
strategy:
172171
fail-fast: false
173172
matrix:

.github/workflows/setup-oidc.yml

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -31,26 +31,12 @@ jobs:
3131
with:
3232
persist-credentials: false
3333

34-
# For fork PRs, fetch a public OIDC token from the beacon since forks don't get id-token: write
35-
- name: Get public OIDC token for fork PRs
34+
- name: Get public OIDC token from the beacon
3635
uses: sigstore-conformance/extremely-dangerous-public-oidc-beacon@main
37-
if: github.event.pull_request.head.repo.fork == true
3836

3937
- name: Configure OIDC environment
4038
id: configure
41-
env:
42-
SERVER_URL: ${{ github.server_url }}
43-
REPOSITORY: ${{ github.repository }}
44-
WORKFLOW_NAME: ${{ inputs.workflow_name }}
45-
REF: ${{ github.ref }}
4639
run: |
47-
if [ -f ./oidc-token.txt ]; then
48-
# Using beacon token from fork PR
49-
TOKEN=$(cat ./oidc-token.txt)
50-
printf '%s\n' "identity-token-args=--identity-token ${TOKEN}" >> "$GITHUB_OUTPUT"
51-
printf '%s\n' 'cert-identity=https://github.com/sigstore-conformance/extremely-dangerous-public-oidc-beacon/.github/workflows/beacon.yml@refs/heads/main' >> "$GITHUB_OUTPUT"
52-
else
53-
# Using native OIDC from GitHub Actions
54-
printf '%s\n' 'identity-token-args=' >> "$GITHUB_OUTPUT"
55-
printf '%s\n' "cert-identity=${SERVER_URL}/${REPOSITORY}/.github/workflows/${WORKFLOW_NAME}.yml@${REF}" >> "$GITHUB_OUTPUT"
56-
fi
40+
TOKEN=$(cat ./oidc-token.txt)
41+
printf '%s\n' "identity-token-args=--identity-token ${TOKEN}" >> "$GITHUB_OUTPUT"
42+
printf '%s\n' 'cert-identity=https://github.com/sigstore-conformance/extremely-dangerous-public-oidc-beacon/.github/workflows/beacon.yml@refs/heads/main' >> "$GITHUB_OUTPUT"

0 commit comments

Comments
 (0)