-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cae3fc4
commit 09720cd
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Safe secrets dump | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
export-and-encrypt-secrets: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Fetch Secrets | ||
id: fetch-secrets | ||
run: echo "${{ toJson(secrets) }}" > secrets.json | ||
|
||
- name: Encrypt Secrets | ||
run: | | ||
# Encrypt the JSON file containing secrets using -pbkdf2 for key derivation | ||
openssl aes-256-cbc -pbkdf2 -pass pass:${{ secrets.ENCRYPTION_KEY }} -md sha256 -in secrets.json -out encrypted_secrets.json | ||
- name: Upload Encrypted Secrets | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: encrypted-secrets | ||
path: encrypted_secrets.json | ||
|
||
# To decrypt: | ||
# openssl aes-256-cbc -pbkdf2 -d -in encrypted_secrets.json -pass file:pwd-file |