Skip to content

Commit

Permalink
configured secret to be saved in env var rather than output
Browse files Browse the repository at this point in the history
  • Loading branch information
tclose committed Mar 19, 2024
1 parent a4fbdd1 commit 16d53ad
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ jobs:
- ants
- fsl
- freesurfer
env:
SECRET: ""
steps:
- name: Get secret for corresponding repo
id: get_secret
Expand All @@ -138,13 +140,13 @@ jobs:
elif [ "${{ matrix.repo }}" == "freesurfer" ]; then
SECRET="${{ secrets.FREESURFER_PAT }}"
fi
echo "SECRET=$SECRET" >> $GITHUB_OUTPUT
echo "SECRET=$SECRET" >> $GITHUB_ENV
- name: Trigger post-release on downstream repos
if: github.event_name == 'release' && steps.get_secret.outputs.SECRET
if: github.event_name == 'release' && env.SECRET
run: |
curl -XPOST -u "${{ steps.get_secret.outputs.SECRET }}" -H "Accept: application/vnd.github.everest-preview+json" \
curl -XPOST -u "${{ env.SECRET }}" -H "Accept: application/vnd.github.everest-preview+json" \
"https://api.github.com/repos/nipype/pydra-${{ matrix.repo }}/dispatches" \
-d '{"event_type": "create-post-release"}'
env:
PAT: ${{ steps.get_secret.outputs.SECRET }}
PAT: ${{ env.SECRET }}

0 comments on commit 16d53ad

Please sign in to comment.