diff --git a/.github/workflows/create-cms-pr.yml b/.github/workflows/create-cms-pr.yml index 101b77595..cf67691f8 100644 --- a/.github/workflows/create-cms-pr.yml +++ b/.github/workflows/create-cms-pr.yml @@ -1,9 +1,6 @@ name: Create CMS PR on: - workflow_run: - workflows: ["Create release on branch changes"] - types: - - completed + workflow_dispatch: jobs: invoke-external-pr-workflow: @@ -46,8 +43,17 @@ jobs: } env: REQUEST_URL: ${{ format('https://api.github.com/repos/{0}/dispatches', vars.REMOTE_REPO_GITHUB_HANDLE) }} - # Only invoke external PR workflow if the release branch is not develop or master - if: ${{ !contains(fromJSON('["develop", "master"]'), env.RELEASE_BRANCH) }} + # Only invoke external PR workflow if the release branch is not develop or main + if: ${{ !contains(fromJSON('["develop", "main"]'), env.RELEASE_BRANCH) }} + + + # - name: John + # run: | + # gh api -X POST / + # -H 'Accept: application/vnd.github+json' / + # -H 'Authorization: "${{ format('Bearer {0}', secrets.CMS_PR_CREATION_PAT) }}"' / + # ${{ format('/repos/{0}/dispatches', vars.REMOTE_REPO_GITHUB_HANDLE) }} + - name: Adding summary run: | @@ -57,9 +63,9 @@ jobs: env: BRANCH_URL: "${{ github.event.repository.html_url }}/tree/${{ env.RELEASE_BRANCH }}" REMOTE_REPO_GITHUB_HANDLE: "${{ vars.REMOTE_REPO_GITHUB_HANDLE }}" - - name: Adding summary about skip if branch is develop or master - # TODO: remove hardcoded org/repo + + - name: Adding summary about skip if branch is develop or main run: | echo "Skipped PR creation because the branch was: $RELEASE_BRANCH " >> $GITHUB_STEP_SUMMARY echo "...which is not considered being a release branch. " >> $GITHUB_STEP_SUMMARY - if: ${{ contains(fromJSON('["develop", "master"]'), env.RELEASE_BRANCH) }} + if: ${{ contains(fromJSON('["develop", "main"]'), env.RELEASE_BRANCH) }} diff --git a/.github/workflows/create-release-on-branch-changes.yml b/.github/workflows/create-release-on-branch-changes.yml index 5475c1b78..9aeaf7c56 100644 --- a/.github/workflows/create-release-on-branch-changes.yml +++ b/.github/workflows/create-release-on-branch-changes.yml @@ -85,15 +85,15 @@ jobs: body: ${{ env.RELEASE_DESCRIPTION }} files: ${{ env.DIST_FILENAME }} - - name: Write release information in artifact file - run: | - printf '{ - "release_branch": "${{ env.RELEASE_BRANCH }}", - "dependency_package": "danskernesdigitalebibliotek/dpl-design-system", - "release_download_url": "${{ env.DOWNLOAD_URL }}" - }' >> release-info.json - env: - DOWNLOAD_URL: "${{ github.event.repository.html_url }}/releases/download/${{ env.TAG_NAME }}/${{ env.DIST_FILENAME }}" + # - name: Write release information in artifact file + # run: | + # printf '{ + # "release_branch": "${{ env.RELEASE_BRANCH }}", + # "dependency_package": "danskernesdigitalebibliotek/dpl-design-system", + # "release_download_url": "${{ env.DOWNLOAD_URL }}" + # }' >> release-info.json + # env: + # DOWNLOAD_URL: "${{ github.event.repository.html_url }}/releases/download/${{ env.TAG_NAME }}/${{ env.DIST_FILENAME }}" - uses: actions/upload-artifact@v3 with: