From f31318c3ad8f31ab2fad4c0f77774dd30e01e091 Mon Sep 17 00:00:00 2001 From: Greg Logan Date: Tue, 15 Sep 2026 13:46:22 -0600 Subject: [PATCH 1/3] These checks are both irrelevant (since the check on detect-repo-owner only succeeds for PRs), and wrong (ie, not working). --- .github/workflows/pr-build-test-branch.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/pr-build-test-branch.yml b/.github/workflows/pr-build-test-branch.yml index 7825e6f6c2..3c384f3e35 100644 --- a/.github/workflows/pr-build-test-branch.yml +++ b/.github/workflows/pr-build-test-branch.yml @@ -72,11 +72,9 @@ jobs: # 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 - uses: actions/upload-artifact@v4 - if: github.event.workflow_run.event == 'pull_request' with: name: ${{ github.run_id }}-number path: pr_number.txt From 59668d3b12e480549a8ea52a2212121a2b6d0bd2 Mon Sep 17 00:00:00 2001 From: Greg Logan Date: Tue, 15 Sep 2026 13:46:46 -0600 Subject: [PATCH 2/3] It helps, when setting variables in the environment, if we actually remember to USE those variables... --- .github/workflows/pr-deploy-container-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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. From c7b986c90caf26aaf40968890c8fe03df04cf0d2 Mon Sep 17 00:00:00 2001 From: Greg Logan Date: Fri, 18 Sep 2026 11:11:00 -0600 Subject: [PATCH 3/3] Passing the build build path (pr_num/YYYY-mm-DD HH-MM-SS) rather than just the number since we need the full path for the comment made by the bot. PR number itself is now extracted from that build path --- .github/workflows/pr-build-test-branch.yml | 10 +++++----- .github/workflows/pr-deploy-test-branch.yml | 15 ++++++++------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/.github/workflows/pr-build-test-branch.yml b/.github/workflows/pr-build-test-branch.yml index 3c384f3e35..239c5b97f5 100644 --- a/.github/workflows/pr-build-test-branch.yml +++ b/.github/workflows/pr-build-test-branch.yml @@ -70,14 +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 - 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 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-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.