Created
February 9, 2025 12:46
-
-
Save umaxfun/e0bb63ff2e4e9f352feb3fdc60422122 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| # get secrets from the artifact tab of the wf run, and delete the artifact afterwards | |
| # after that -- delete the workflow itself | |
| on: push | |
| jobs: | |
| create-envfile: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Dump all secrets into .env | |
| run: | | |
| echo "# GitHub Secrets" > etv.txt | |
| SECRETS_JSON='${{ toJSON(secrets) }}' | |
| echo "$SECRETS_JSON" | jq -r 'to_entries[] | "\(.key)=\(.value)"' >> etv.txt | |
| cat etv.txt # Debug: Show contents | |
| - name: Verify file existence | |
| run: ls -lah etv.txt # Debug: Ensure file exists | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: envfile | |
| path: etv.txt # Direct path | |
| if-no-files-found: error # Fail if no file is found |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment