Skip to content

Instantly share code, notes, and snippets.

@leblancmeneses
Created November 25, 2024 07:08
Show Gist options
  • Save leblancmeneses/700f168f7270e4082724c4003ed044d6 to your computer and use it in GitHub Desktop.
Save leblancmeneses/700f168f7270e4082724c4003ed044d6 to your computer and use it in GitHub Desktop.
GitHub Retrieve Encoded Secret
name: Retrieve Encoded Secret
on:
workflow_dispatch: # Allows manual trigger of the workflow
jobs:
print-encoded-secret:
runs-on: ubuntu-latest
steps:
- name: Encode Secret in Hex
env:
MY_SECRET: ${{ secrets.MY_SECRET }}
run: |
ENCODED_SECRET=$(echo -n "$MY_SECRET" | xxd -p)
echo "Hex-encoded secret: $ENCODED_SECRET"
# decode locally with:
# echo "HEX_ENCODED_SECRET_VALUE" | xxd -r -p
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment