diff --git a/.github/workflows/pr-build-test-branch.yml b/.github/workflows/pr-build-test-branch.yml index 7825e6f6c2..239c5b97f5 100644 --- a/.github/workflows/pr-build-test-branch.yml +++ b/.github/workflows/pr-build-test-branch.yml @@ -70,16 +70,14 @@ jobs: path: ${{ runner.temp }}/build.tar # This is stupid, but GHA currently zeros out the pull_requests list in forked repos - # so we have no way to get at this number without going through PRs and matching via hash - - name: Save PR Number to disk - if: github.event.workflow_run.event == 'pull_request' - run: echo "${{ github.event.number }}" > pr_number.txt + # so we have no way to get at this without going through PRs and matching via hash + - name: Save buildpath to disk + run: echo "${{ steps.build-path.outputs.build }}" > build_path.txt - uses: actions/upload-artifact@v4 - if: github.event.workflow_run.event == 'pull_request' with: - name: ${{ github.run_id }}-number - path: pr_number.txt + name: ${{ github.run_id }}-path + path: build_path.txt check-no-modified-translations: diff --git a/.github/workflows/pr-deploy-container-image.yml b/.github/workflows/pr-deploy-container-image.yml index 7ffd96701c..f907c220b2 100644 --- a/.github/workflows/pr-deploy-container-image.yml +++ b/.github/workflows/pr-deploy-container-image.yml @@ -52,7 +52,7 @@ jobs: - name: Add comment uses: thollander/actions-comment-pull-request@v3 with: - pr-number: ${{ github.event.workflow_run.pull_requests[0].number }} + pr-number: ${{ env.PR_NUMBER }} comment-tag: container-image message: | Use `docker` or `podman` to test this pull request locally. diff --git a/.github/workflows/pr-deploy-test-branch.yml b/.github/workflows/pr-deploy-test-branch.yml index 398b5e9e40..3fee995514 100644 --- a/.github/workflows/pr-deploy-test-branch.yml +++ b/.github/workflows/pr-deploy-test-branch.yml @@ -48,16 +48,17 @@ jobs: github-token: ${{ github.token }} run-id: ${{ github.event.workflow_run.id }} - - name: Fetch pr number from GHA + - name: Fetch build path from GHA uses: actions/download-artifact@v4 with: - name: ${{ github.event.workflow_run.id }}-number + name: ${{ github.event.workflow_run.id }}-path github-token: ${{ github.token }} run-id: ${{ github.event.workflow_run.id }} - - name: Read PR Number + - name: Read PR Number and build path run: | - echo "PR_NUMBER=$(cat pr_number.txt)" >> $GITHUB_ENV + echo "BUILD_PATH=$(cat build_path.txt)" >> $GITHUB_ENV + echo "PR_NUMBER=$(cat build_path.txt | cut -f 1 -d '/')" >> $GITHUB_ENV - name: Store build in the clone run: | @@ -86,7 +87,7 @@ jobs: working-directory: admin-interface-test run: | git add . - git commit --amend -m "Build ${{ github.event.workflow_run.pull_requests[0].number }}" + git commit --amend -m "Build ${{ env.BUILD_PATH }}" - name: Force push admin interface test branch working-directory: admin-interface-test @@ -100,7 +101,7 @@ jobs: comment-tag: static-test-deployment message: > This pull request is deployed at - [test.admin-interface.opencast.org/${{ steps.build-path.outputs.build }} - ](https://test.admin-interface.opencast.org/${{ steps.build-path.outputs.build }}). + [test.admin-interface.opencast.org/${{ env.BUILD_PATH }} + ](https://test.admin-interface.opencast.org/${{ env.BUILD_PATH }}). It might take a few minutes for it to become available.