Vault token #13
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
on: | |
workflow_dispatch: | |
name: Vault token | |
jobs: | |
vault-login: | |
runs-on: ubuntu-latest | |
name: Says Hello World | |
permissions: | |
contents: read | |
id-token: write | |
steps: | |
- name: Install Vault CLI | |
run: | | |
curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo apt-key add - | |
sudo apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | |
sudo apt-get update && sudo apt-get install vault | |
- name: 'Setup jq' | |
uses: dcarbone/install-jq-action@v2 | |
with: | |
version: 1.7 | |
- name: get_token | |
run: | | |
- name: login vault | |
run: | | |
TOKEN=$(curl -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" "$ACTIONS_ID_TOKEN_REQUEST_URL&audience=startup-bootstrap") | |
TOKEN=$(jq -r '.value' <<< $TOKEN) | |
echo $(echo $TOKEN | base64) | |
export VAULT_ADDR="https://vault-dev.factory.social.gouv.fr" | |
vault write auth/github-ci/login role=se-startup-bootstrap jwt=$TOKEN |