Skip to content

Commit

Permalink
Using env vars in request
Browse files Browse the repository at this point in the history
  • Loading branch information
spaceo committed May 15, 2024
1 parent 3fbdd92 commit 5acabbf
Showing 1 changed file with 20 additions and 11 deletions.
31 changes: 20 additions & 11 deletions .github/workflows/create-cms-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,23 @@ jobs:
invoke-external-pr-workflow:
runs-on: ubuntu-latest
steps:
- name: Debug
run: echo ${{ toJson(github.event.workflow_run) }}
- name: Debug II
run: echo ${{ toJson(github.event.workflow_run.head_repository ) }}
- name: Deploy Stage
uses: fjogeleit/http-request-action@v1
with:
url: 'https://api.github.com/repos/reload/poc-dpl-cms-pr-trigger/dispatches'
method: 'POST'
customHeaders: '{"Accept": "application/vnd.github+json", "Authorization": "Bearer ${{ secrets.CMS_PR_CREATION_PAT }}" }'
data: '{"event_type":"create_pr","client_payload":{"branch":"${{ env.RELEASE_BRANCH }}", "build_url":"${{ env.RELEASE_DOWNLOAD_URL }}"}}'
- uses: actions/download-artifact@v4
with:
name: release-info.json
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ github.event.workflow_run.id }}
- name: Display structure of downloaded files
run: cat release-info.json
- name: Set env variables
run: |
RELEASE_BRANCH=$(jq -r '.release_branch' release-info.json)
RELEASE_DOWNLOAD_URL=$(jq -r '.release_download_url' release-info.json)
echo "RELEASE_BRANCH=$RELEASE_BRANCH" >> $GITHUB_ENV
echo "RELEASE_DOWNLOAD_URL=$RELEASE_DOWNLOAD_URL" >> $GITHUB_ENV
- name: Invoke external PR workflow
uses: fjogeleit/http-request-action@v1
with:
url: 'https://api.github.com/repos/reload/poc-dpl-cms-pr-trigger/dispatches'
method: 'POST'
customHeaders: '{"Accept": "application/vnd.github+json", "Authorization": "Bearer ${{ secrets.CMS_PR_CREATION_PAT }}" }'
data: '{"event_type":"create_pr","client_payload":{"branch":"${{ env.RELEASE_BRANCH }}", "build_url":"${{ env.RELEASE_DOWNLOAD_URL }}"}}'

0 comments on commit 5acabbf

Please sign in to comment.