Skip to content

Commit f508f74

Browse files
committed
ci: test AWS OIDC for Nix releases
DO NOT MERGE This is a test run to check that the IAM role and OIDC setup on the AWS account is setup correctly.
1 parent 4a2fb18 commit f508f74

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Test Release OIDC
2+
3+
on:
4+
workflow_dispatch:
5+
6+
permissions:
7+
contents: read
8+
id-token: write
9+
10+
jobs:
11+
oidc-check:
12+
runs-on: ubuntu-latest
13+
environment: releases
14+
steps:
15+
- name: Configure AWS credentials
16+
uses: aws-actions/configure-aws-credentials@v4
17+
with:
18+
role-to-assume: "arn:aws:iam::080433136561:role/nix-release"
19+
role-session-name: nix-release-oidc-test-${{ github.run_id }}
20+
aws-region: eu-west-1
21+
22+
- name: Verify AWS identity
23+
run: aws sts get-caller-identity
24+
25+
- name: Confirm access to release bucket
26+
run: |
27+
set -euo pipefail
28+
KEY=$(aws s3api list-objects-v2 --bucket nix-releases --prefix nix/ --max-items 1 --query 'Contents[0].Key' --output text)
29+
if [ "$KEY" = "None" ] || [ -z "$KEY" ]; then
30+
echo "No objects found under nix/ prefix in nix-releases bucket" >&2
31+
exit 1
32+
fi
33+
echo "Found object $KEY"
34+
aws s3api head-object --bucket nix-releases --key "$KEY" --output json

0 commit comments

Comments
 (0)