From aa7d049891ed8017d6ddfe6218699a8efb5030ed Mon Sep 17 00:00:00 2001 From: zimbatm Date: Sun, 2 Nov 2025 13:46:23 +0100 Subject: [PATCH] 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. --- .github/workflows/test-release-oidc.yml | 35 +++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/test-release-oidc.yml diff --git a/.github/workflows/test-release-oidc.yml b/.github/workflows/test-release-oidc.yml new file mode 100644 index 000000000000..a77c07b19343 --- /dev/null +++ b/.github/workflows/test-release-oidc.yml @@ -0,0 +1,35 @@ +name: Test Release OIDC + +on: + pull_request: + workflow_dispatch: + +permissions: + contents: read + id-token: write + +jobs: + oidc-check: + runs-on: ubuntu-latest + environment: releases + steps: + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: "arn:aws:iam::080433136561:role/nix-release" + role-session-name: nix-release-oidc-test-${{ github.run_id }} + aws-region: eu-west-1 + + - name: Verify AWS identity + run: aws sts get-caller-identity + + - name: Confirm access to release bucket + run: | + set -euo pipefail + KEY=$(aws s3api list-objects-v2 --bucket nix-releases --prefix nix/ --max-items 1 --query 'Contents[0].Key' --output text) + if [ "$KEY" = "None" ] || [ -z "$KEY" ]; then + echo "No objects found under nix/ prefix in nix-releases bucket" >&2 + exit 1 + fi + echo "Found object $KEY" + aws s3api head-object --bucket nix-releases --key "$KEY" --output json