Skip to content

Commit

Permalink
use GITHUB_ENV for OIDC_TOKEN
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastian-luna-valero committed Sep 19, 2024
1 parent a055d4f commit d416b4e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,12 @@ jobs:
> ~/.mytoken/config.yaml
# add PWD to the PATH
echo "$PWD" >> "$GITHUB_PATH"
# add OIDC access token to ENV
OIDC_TOKEN=$(mytoken AT --MT-env MYTOKEN)
echo "::add-mask::$OIDC_TOKEN"
echo "OIDC_TOKEN=$OIDC_TOKEN" >> "$GITHUB_ENV"
- name: Configure providers access
env:
MYTOKEN: ${{ secrets.MYTOKEN }}
run: |
cd deployment
./site-config.sh
Expand Down Expand Up @@ -113,8 +116,6 @@ jobs:
- name: Configure with ansible
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
uses: dawidd6/action-ansible-playbook@v2
env:
MYTOKEN: ${{ secrets.MYTOKEN }}
with:
playbook: playbook.yaml
directory: ./deployment
Expand All @@ -124,7 +125,7 @@ jobs:
${{ steps.public_ip.outputs.stdout }}
requirements: galaxy-requirements.yaml
options: |
--extra-vars ACCESS_TOKEN="$(mytoken AT --MT-env MYTOKEN)"
--extra-vars ACCESS_TOKEN=${{ env.OIDC_TOKEN }}
--extra-vars git_ref=${{ github.sha }}
--ssh-common-args="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null"
-u egi
4 changes: 1 addition & 3 deletions deployment/site-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ dump_config() {
EOF
}

OIDC_TOKEN=$(mytoken AT --MT-env MYTOKEN)

echo "::add-mask::$OIDC_TOKEN"
# using OIDC_TOKEN generated in .github/workflows/deploy.yaml

rm -f clouds.yaml
echo "clouds:" > tmp-clouds.yaml
Expand Down

0 comments on commit d416b4e

Please sign in to comment.