Skip to content

Commit 77b625b

Browse files
committed
feat: integrate polykey into workflow
1 parent 929ffcc commit 77b625b

File tree

4 files changed

+7
-10
lines changed

4 files changed

+7
-10
lines changed

.github/workflows/clean.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ jobs:
2323
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
2424
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
2525
ZONE_ID: ${{ secrets.ZONE_ID }}
26-
AUTH_KEY: ${{ secrets.AUTH_KEY }}
27-
AUTH_EMAIL: ${{ secrets.AUTH_EMAIL }}
26+
POLYKEY_DOCS_CLOUDFLARE_CLEANUP_TOKEN: ${{ secrets.POLYKEY_DOCS_CLOUDFLARE_CLEANUP_TOKEN }}
2827
run: |
2928
echo 'Perform service deployment for feature'
3029
nix develop .#ci --command bash -c $'

flake.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
shellHook = ''
2020
echo "Entering $(npm pkg get name)"
2121
set -o allexport
22-
. ./.env
22+
. <(pk secrets env Polykey-Docs:.)
2323
set +o allexport
2424
set -v
2525
${lib.optionalString ci ''

scripts/certs_cleanup.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,12 @@
22

33
response=$(curl -X GET "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/ssl/certificate_packs" \
44
-H "Content-Type: application/json" \
5-
-H "X-Auth-Key: $AUTH_KEY" \
6-
-H "X-Auth-Email: $AUTH_EMAIL")
5+
-H "Authorization: Bearer $POLYKEY_DOCS_CLOUDFLARE_CLEANUP_TOKEN")
76

87
cert_ids=$(echo "$response" | jq -r --arg domain "$DOMAIN" '.result[] | select(.hosts[] | contains($domain)) | .id')
98

109
echo "$cert_ids" | while read -r cert_id; do
1110
curl -X DELETE --url "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/ssl/certificate_packs/$cert_id" \
1211
-H "Content-Type: application/json" \
13-
-H "X-Auth-Key: $AUTH_KEY" \
14-
-H "X-Auth-Email: $AUTH_EMAIL"
12+
-H "Authorization: Bearer $POLYKEY_DOCS_CLOUDFLARE_CLEANUP_TOKEN"
1513
done

0 commit comments

Comments
 (0)