Skip to content

Commit d1bfbf5

Browse files
authored
Update copy-secrets-to-lavc-lite.yml
1 parent 97a0556 commit d1bfbf5

1 file changed

Lines changed: 14 additions & 4 deletions

File tree

.github/workflows/copy-secrets-to-lavc-lite.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,30 @@ jobs:
88
runs-on: ubuntu-latest
99

1010
steps:
11+
- name: Validate source secrets
12+
env:
13+
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
14+
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
15+
TRANSFER_PAT: ${{ secrets.TRANSFER_PAT }}
16+
run: |
17+
test -n "$CLOUDFLARE_API_TOKEN" || (echo "CLOUDFLARE_API_TOKEN is empty" && exit 1)
18+
test -n "$CLOUDFLARE_ACCOUNT_ID" || (echo "CLOUDFLARE_ACCOUNT_ID is empty" && exit 1)
19+
test -n "$TRANSFER_PAT" || (echo "TRANSFER_PAT is empty" && exit 1)
20+
1121
- name: Copy CLOUDFLARE_API_TOKEN to target repo
1222
env:
1323
GH_TOKEN: ${{ secrets.TRANSFER_PAT }}
1424
SECRET_VALUE: ${{ secrets.CLOUDFLARE_API_TOKEN }}
1525
run: |
16-
printf "%s" "$SECRET_VALUE" | gh secret set CLOUDFLARE_API_TOKEN \
26+
gh secret set CLOUDFLARE_API_TOKEN \
1727
--repo PkLavc/lavc-systems-lite \
18-
--body-file -
28+
--body "$SECRET_VALUE"
1929
2030
- name: Copy CLOUDFLARE_ACCOUNT_ID to target repo
2131
env:
2232
GH_TOKEN: ${{ secrets.TRANSFER_PAT }}
2333
SECRET_VALUE: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
2434
run: |
25-
printf "%s" "$SECRET_VALUE" | gh secret set CLOUDFLARE_ACCOUNT_ID \
35+
gh secret set CLOUDFLARE_ACCOUNT_ID \
2636
--repo PkLavc/lavc-systems-lite \
27-
--body-file -
37+
--body "$SECRET_VALUE"

0 commit comments

Comments
 (0)