Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use GITHUB_ENV for OIDC_TOKEN #63

Merged
merged 7 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,11 @@ 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 +115,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 +124,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
Loading