Create CMS PR #34
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
name: Create CMS PR | |
on: | |
workflow_run: | |
workflows: ["Create release on branch changes"] | |
types: | |
- completed | |
jobs: | |
invoke-external-pr-workflow: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
name: release-info.json | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
run-id: ${{ github.event.workflow_run.id }} | |
- 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 }}"}}' |