Merge pull request #311 from nikhilbadyal/chore/envs

👷 Updated print-secrets.yml
This commit is contained in:
Nikhil Badyal
2023-08-25 22:24:46 +05:30
committed by GitHub
+27 -11
View File
@@ -1,18 +1,34 @@
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"
required: false
type: boolean
default: false
jobs:
create-envfile:
runs-on: ubuntu-latest
steps:
- name: Make envfile
uses: SpicyPizza/create-envfile@main
with:
envkey_SECRETS: ${{ toJSON(secrets) }}
file_name: .github_secrets
fail_on_empty: false
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: github_secrets
path: .github_secrets
- name: Save all .envs file
if: inputs.ALL
run: |
python -c "import os; file = open('.env_all', 'w'); file.write(os.environ['ALL']); file.close()"
shell: bash
env:
ALL: ${{ toJSON(secrets) }}
- name: Save ENVS
if: inputs.ALL
run: |
python -c "import os; file = open('.env', 'w'); file.write(os.environ['ENVS']); file.close()"
shell: bash
env:
ENVS: ${{ secrets.ENVS }}
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: github_secrets
path: .env*