@@ -41,46 +41,45 @@ jobs:
4141
4242 - name : Sign dist/index.js
4343 env :
44- AUTHS_PASSPHRASE : ${{ secrets.AUTHS_CI_PASSPHRASE }}
45- AUTHS_CI_KEYCHAIN_B64 : ${{ secrets.AUTHS_CI_KEYCHAIN }}
46- AUTHS_CI_IDENTITY_BUNDLE_B64 : ${{ secrets.AUTHS_CI_IDENTITY_BUNDLE }}
44+ AUTHS_CI_TOKEN : ${{ secrets.AUTHS_CI_TOKEN }}
4745 AUTHS_KEYCHAIN_BACKEND : file
4846 AUTHS_KEYCHAIN_FILE : /tmp/auths-ci-keychain
4947 run : |
50- if [ -z "$AUTHS_PASSPHRASE" ] || [ -z "$AUTHS_CI_KEYCHAIN_B64" ] || [ -z "$AUTHS_CI_IDENTITY_BUNDLE_B64 " ]; then
51- echo "::warning::Skipping artifact signing: AUTHS_CI_PASSPHRASE, AUTHS_CI_KEYCHAIN, and AUTHS_CI_IDENTITY_BUNDLE must all be set "
48+ if [ -z "$AUTHS_CI_TOKEN " ]; then
49+ echo "::warning::Skipping artifact signing: AUTHS_CI_TOKEN not set (run 'auths ci setup' to configure) "
5250 exit 0
5351 fi
5452
55- printf '%s' "$AUTHS_CI_KEYCHAIN_B64" | tr -d '[:space:]' | base64 -d > /tmp/auths-ci-keychain
56- mkdir -p /tmp/auths-identity
57- printf '%s' "$AUTHS_CI_IDENTITY_BUNDLE_B64" | tr -d '[:space:]' | base64 -d | tar -xz -C /tmp/auths-identity
53+ # Extract fields from the single CI token
54+ AUTHS_PASSPHRASE=$(echo "$AUTHS_CI_TOKEN" | jq -r '.passphrase')
55+ echo "::add-mask::$AUTHS_PASSPHRASE"
56+ export AUTHS_PASSPHRASE
5857
59- # Find the actual .auths dir (may be nested as .auths/ inside the tarball)
60- if [ -d /tmp/auths-identity/.auths ]; then
61- AUTHS_REPO=/tmp/auths-identity/.auths
62- else
63- AUTHS_REPO=/tmp/auths-identity
64- fi
58+ echo "$AUTHS_CI_TOKEN" | jq -r '.keychain' | base64 -d > /tmp/auths-ci-keychain
59+ mkdir -p /tmp/auths-identity
60+ echo "$AUTHS_CI_TOKEN" | jq -r '.identity_repo' | base64 -d | tar -xz -C /tmp/auths-identity
6561
66- if ! git -C "$AUTHS_REPO" rev-parse --git-dir > /dev/null 2>&1; then
67- echo "::warning::Skipping artifact signing: AUTHS_CI_IDENTITY_BUNDLE does not contain a valid git repository"
62+ if ! git -C /tmp/auths-identity rev-parse --git-dir > /dev/null 2>&1; then
63+ echo "::warning::Skipping artifact signing: identity repo in AUTHS_CI_TOKEN is not a valid git repository"
6864 exit 0
6965 fi
7066
7167 auths artifact sign dist/index.js \
7268 --device-key ci-release-device \
7369 --note "GitHub Actions release — ${GITHUB_REF_NAME}" \
74- --repo "$AUTHS_REPO"
70+ --repo /tmp/auths-identity
7571
7672 echo "Signed dist/index.js → dist/index.js.auths.json"
7773
74+ # Write verify bundle for next step
75+ echo "$AUTHS_CI_TOKEN" | jq -r '.verify_bundle' > /tmp/auths-verify-bundle.json
76+
7877 # --- Verify the artifact we just signed (dogfood) ---
7978 - name : Verify dist/index.js attestation
8079 if : hashFiles('dist/index.js.auths.json') != ''
8180 uses : ./
8281 with :
83- identity : ${{ secrets.AUTHS_CI_IDENTITY_BUNDLE_JSON }}
82+ identity : /tmp/auths-verify-bundle.json
8483 artifact-paths : ' dist/index.js'
8584 fail-on-unattested : true
8685 fail-on-unsigned : false
0 commit comments