-
Notifications
You must be signed in to change notification settings - Fork 437
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
352e7bc
commit fccaa6a
Showing
1 changed file
with
22 additions
and
8 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 |
---|---|---|
@@ -1,33 +1,47 @@ | ||
name: Print Github Secrets | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
ALL: | ||
description: "Whether to export all envs. Please be very careful. Make sure to delete the file after downloading" | ||
description: "Whether to export all envs. Please be very careful. Make sure to delete the file after downloading." | ||
required: false | ||
type: boolean | ||
default: false | ||
|
||
jobs: | ||
create-envfile: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Save all .envs file | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Save All Environment Variables to envs_all.env (If Enabled) | ||
if: inputs.ALL | ||
run: | | ||
python -c "import os; file = open('.env_all', 'w'); file.write(os.environ['ALL']); file.close()" | ||
python -c "import os; file = open('envs_all.env', 'w'); \ | ||
file.write(os.getenv('ALL', '')); file.close()" | ||
shell: bash | ||
env: | ||
ALL: ${{ toJSON(secrets) }} | ||
|
||
- name: Save ENVS | ||
- name: Save ENVS Secret to envs.env | ||
run: | | ||
python -c "import os; file = open('.env', 'w'); file.write(os.environ['ENVS']); file.close()" | ||
python -c "import os; file = open('envs.env', 'w'); \ | ||
file.write(os.getenv('ENVS', '')); file.close()" | ||
shell: bash | ||
env: | ||
ENVS: ${{ secrets.ENVS }} | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-artifact@v4 | ||
- name: Verify Created envs Files | ||
run: | | ||
echo "Checking if envs.env exist..." | ||
ls -lha envs.env* | ||
- name: Upload Environment Files as Artifact | ||
uses: actions/upload-artifact@v4.6.0 | ||
with: | ||
name: github_secrets | ||
path: .env* | ||
path: envs* | ||
if-no-files-found: error |