Skip to content

Commit 9162c48

Browse files
committed
fix: use JSON identity bundle secret for CI artifact verification
1 parent 7cf512b commit 9162c48

2 files changed

Lines changed: 18 additions & 3 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,6 @@ jobs:
5656
- name: Verify dist/index.js attestation
5757
uses: ./
5858
with:
59-
identity-bundle-json: ${{ secrets.AUTHS_CI_IDENTITY_BUNDLE }}
59+
identity-bundle-json: ${{ secrets.AUTHS_CI_IDENTITY_BUNDLE_JSON }}
6060
artifact-paths: 'dist/index.js'
6161
fail-on-unattested: true

scripts/ci-setup.sh

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ else
142142
echo -e "${GREEN}${RESET} CI device linked"
143143
fi
144144

145-
# --- Step 8: Package identity repo ---
145+
# --- Step 8: Package identity repo (for release signing) ---
146146
AUTHS_DIR="${HOME}/.auths"
147147
echo -e "${DIM}Packaging identity repo...${RESET}"
148148

@@ -161,6 +161,17 @@ tar -czf "$BUNDLE_PATH" \
161161

162162
IDENTITY_BUNDLE_B64=$(base64 < "$BUNDLE_PATH" | tr -d '\n')
163163

164+
# --- Step 8b: Export identity bundle JSON (for CI artifact verification) ---
165+
echo -e "${DIM}Exporting identity bundle JSON (1-year TTL)...${RESET}"
166+
BUNDLE_JSON_PATH="$TMPDIR_WORK/identity-bundle.json"
167+
auths id export-bundle \
168+
--alias ci-release-device \
169+
--output "$BUNDLE_JSON_PATH" \
170+
--max-age-secs 31536000
171+
172+
IDENTITY_BUNDLE_JSON=$(cat "$BUNDLE_JSON_PATH")
173+
echo -e "${GREEN}${RESET} Identity bundle JSON exported (expires in 1 year)"
174+
164175
# --- Step 9: Set GitHub secrets ---
165176
echo ""
166177
echo -e "${GREEN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${RESET}"
@@ -186,10 +197,11 @@ if [ "$GH_OK" -eq 1 ]; then
186197
echo -n "$CI_PASS" | gh secret set AUTHS_CI_PASSPHRASE --repo "$REPO" || GH_OK=0
187198
echo -n "$KEYCHAIN_B64" | gh secret set AUTHS_CI_KEYCHAIN --repo "$REPO" || GH_OK=0
188199
echo -n "$IDENTITY_BUNDLE_B64" | gh secret set AUTHS_CI_IDENTITY_BUNDLE --repo "$REPO" || GH_OK=0
200+
echo -n "$IDENTITY_BUNDLE_JSON" | gh secret set AUTHS_CI_IDENTITY_BUNDLE_JSON --repo "$REPO" || GH_OK=0
189201
fi
190202

191203
if [ "$GH_OK" -eq 1 ]; then
192-
echo -e "${GREEN}${RESET} All 3 secrets set on ${CYAN}${REPO}${RESET}"
204+
echo -e "${GREEN}${RESET} All 4 secrets set on ${CYAN}${REPO}${RESET}"
193205
else
194206
echo -e "${YELLOW}Could not set secrets automatically.${RESET}"
195207
echo -e "${DIM}Try: gh auth login then re-run, or add manually:${RESET}"
@@ -203,6 +215,9 @@ else
203215
echo ""
204216
echo -e "${BOLD}AUTHS_CI_IDENTITY_BUNDLE${RESET}"
205217
echo "$IDENTITY_BUNDLE_B64"
218+
echo ""
219+
echo -e "${BOLD}AUTHS_CI_IDENTITY_BUNDLE_JSON${RESET}"
220+
echo "$IDENTITY_BUNDLE_JSON"
206221
fi
207222

208223
echo ""

0 commit comments

Comments
 (0)