1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-09 03:56:01 +01:00

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.
This commit is contained in:
zimbatm 2025-11-02 13:46:23 +01:00
parent 4a2fb18ba0
commit e4e53e0a1b

39
.github/workflows/test-release-oidc.yml vendored Normal file
View file

@ -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