From 4476213f82ec2ad6ddebebe6aacd2cd6b6b39f12 Mon Sep 17 00:00:00 2001 From: mchatlas Date: Tue, 15 Sep 2026 12:50:49 +0200 Subject: [PATCH] Fetch Docker secrets from AWS --- .github/workflows/github-actions.yml | 25 ++++++++++++++++++++----- run-build | 2 +- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index 5de006d..fa719de 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -1,6 +1,5 @@ # This workflow will build the project, run integration tests, and release. -# Because secrets are not available on external forks, this job is expected to fail -# on external pull requests. +# Secret-backed jobs fetch credentials from AWS Secrets Manager using GitHub OIDC. name: Build, Check, Publish @@ -13,15 +12,31 @@ on: jobs: build: runs-on: ubuntu-latest + permissions: + id-token: write + contents: read steps: - name: Checkout Repo uses: actions/checkout@v3 + - name: Configure AWS credentials for Docker Hub secrets (OIDC) + if: github.event_name != 'pull_request' + uses: aws-actions/configure-aws-credentials@v6 + with: + role-to-assume: arn:aws:iam::301904545275:role/oidc-github-hellosign-dropbox-sign-node-branch-main + aws-region: us-west-2 + + - name: Get Docker Hub secrets from AWS Secrets Manager + if: github.event_name != 'pull_request' + uses: aws-actions/aws-secretsmanager-get-secrets@v3 + with: + secret-ids: | + DOCKER_USERNAME,github-actions/hellosign/shared/docker-username + DOCKER_TOKEN,github-actions/hellosign/shared/docker-token + parse-json-secrets: false + - name: Build SDK run: ./run-build - env: - DOCKER_USERNAME: ${{secrets.DOCKER_USERNAME}} - DOCKER_TOKEN: ${{secrets.DOCKER_TOKEN}} - name: Ensure no changes in Generated Code run: ./bin/check-clean-git-status diff --git a/run-build b/run-build index 7a26bec..574cbc0 100755 --- a/run-build +++ b/run-build @@ -7,7 +7,7 @@ set -e DIR=$(cd `dirname $0` && pwd) WORKING_DIR="/app/javascript" -if [[ -n "$GITHUB_ACTIONS" ]]; then +if [[ -n "$GITHUB_ACTIONS" && -n "${DOCKER_USERNAME:-}" && -n "${DOCKER_TOKEN:-}" ]]; then printf "\nLogging in to docker.com ...\n" echo "${DOCKER_TOKEN}" | docker login -u "${DOCKER_USERNAME}" --password-stdin fi