-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
workflows: Add OIDC token generation workflow
Signed-off-by: Alex Cameron <asc@tetsuo.sh>
- Loading branch information
1 parent
8699b72
commit a81243c
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: OIDC | ||
|
||
# Run every 5 minutes so we always have a valid OIDC token for clients to use. | ||
on: | ||
schedule: | ||
- cron: '*/5 * * * *' | ||
|
||
# Make sure we cancel any in-progress OIDC generation jobs if they're already queued. | ||
# | ||
# When there's heavy traffic in the GitHub queue, we're not going to be able to keep up with | ||
# generating tokens every 5 minutes and we want to ensure that we don't overlap and queue multiple | ||
# jobs at once. | ||
concurrency: | ||
group: oidc-beacon | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
oidc: | ||
permissions: | ||
# Needed to access the workflow's OIDC identity. | ||
id-token: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.7" | ||
- name: Retrieve OIDC token | ||
run: | | ||
python -m pip install id && | ||
python -m id sigstore > ./oidc-token.txt | ||
- name: Upload OIDC token artifact | ||
uses: actions/upload-artifact@v3.1.0 | ||
with: | ||
name: oidc-token | ||
path: ./oidc-token.txt |