From e4e53e0a1b4d4a5f61d0f87e0cc317bd3edb7ab5 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 | 39 +++++++++++++++++++++++++ 1 file changed, 39 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 000000000..a3c43a6d5 --- /dev/null +++ b/.github/workflows/test-release-oidc.yml @@ -0,0 +1,39 @@ +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/nix-2.31.2/install \ + --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 s3 cp "s3://nix-releases/$KEY" - >/dev/null