Skip to content

Instantly share code, notes, and snippets.

@juandm
Last active August 3, 2022 17:57
Show Gist options
  • Save juandm/e681ee325b26cc3e2a990476d5e00659 to your computer and use it in GitHub Desktop.
Save juandm/e681ee325b26cc3e2a990476d5e00659 to your computer and use it in GitHub Desktop.
See Github workflow secret value if you forgot it

Check secret value in Github workflow

  1. Create a new branch called test-branch.

  2. Create a workflow YAML file in .github folder in the root of your project, with the content below:

    • test.yml

      name: Test workflow
      on:
        push:
          branches:
            - 'test-branch'
      jobs:
        build:
          name: Inspect github secrets
          runs-on: ubuntu-latest
      
          steps:
            - name: See secret value
              run: |
                echo ${{secrets.SECRET_NAME}} | sed 's/./& /g'
  3. Replace the SECRET_NAME by the secret you want to inspect

  4. Commit your changes and push your changes

  5. The workflow will run on push event for branch (test-branch).To see the secret value go to the actions tab in your Github repo and you will find the value where each letter is separated by a space. (This is needed to avoid Github to redact the secret replacing it with ********)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment