Skip to content

Commit 94d2a66

Browse files
committed
ci: migrate release secrets to the monorepo
1 parent 58f1bc6 commit 94d2a66

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Migrate Release Secrets
2+
3+
on:
4+
workflow_dispatch:
5+
6+
permissions:
7+
contents: read
8+
9+
jobs:
10+
migrate:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Transfer encrypted release credentials to A3S-Lab/a3s
14+
shell: bash
15+
env:
16+
GH_TOKEN: ${{ secrets.A3S_MIGRATION_ADMIN_TOKEN }}
17+
CARGO_TOKEN_VALUE: ${{ secrets.CARGO_REGISTRY_TOKEN }}
18+
HOMEBREW_TOKEN_VALUE: ${{ secrets.HOMEBREW_TAP_TOKEN }}
19+
run: |
20+
set -euo pipefail
21+
test -n "${GH_TOKEN:-}"
22+
test -n "${CARGO_TOKEN_VALUE:-}"
23+
test -n "${HOMEBREW_TOKEN_VALUE:-}"
24+
25+
gh secret set CARGO_REGISTRY_TOKEN \
26+
--repo A3S-Lab/a3s --body "$CARGO_TOKEN_VALUE"
27+
gh secret set HOMEBREW_TAP_TOKEN \
28+
--repo A3S-Lab/a3s --body "$HOMEBREW_TOKEN_VALUE"
29+
30+
names="$(gh secret list --repo A3S-Lab/a3s --app actions \
31+
--json name --jq '.[].name')"
32+
grep -Fqx CARGO_REGISTRY_TOKEN <<<"$names"
33+
grep -Fqx HOMEBREW_TAP_TOKEN <<<"$names"

0 commit comments

Comments
 (0)