From 9c8e2859a10a9b08e8684180cabcc8b90fba3689 Mon Sep 17 00:00:00 2001 From: Greg Logan Date: Tue, 31 Mar 2026 22:55:16 -0600 Subject: [PATCH 1/5] Correcting gh pr creation. Branch name needs to be the same everywhere, and GITHUB_REF != github.ref_name. --- .github/workflows/deploy-main-branches.yml | 33 ++++++++++++++-------- 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/.github/workflows/deploy-main-branches.yml b/.github/workflows/deploy-main-branches.yml index 1f02e32816..e9cc15000b 100644 --- a/.github/workflows/deploy-main-branches.yml +++ b/.github/workflows/deploy-main-branches.yml @@ -13,6 +13,7 @@ concurrency: jobs: detect-repo-owner: + name: Detect branch and appropriate server if: github.repository_owner == 'opencast' runs-on: ubuntu-latest outputs: @@ -36,6 +37,7 @@ jobs: deploy-main-branches: + name: Deploy admin-interface.opencast.org runs-on: ubuntu-latest needs: detect-repo-owner steps: @@ -124,7 +126,7 @@ jobs: run: | git clone -b ${{ github.ref_name }} "git@github.com:${{ github.repository_owner }}/opencast.git" opencast cd opencast - git checkout -b t/admin-$GITHUB_REF + git checkout -b t/admin-${{ github.ref_name }} - name: Update the admin submodule working-directory: opencast @@ -135,17 +137,24 @@ jobs: # could end up causing the commit message, and the actual submodule hash to differ. git submodule update --init --remote modules/admin-ui git add modules/admin-ui - git commit -m "Updating admin-service to $GITHUB_REF" - git push origin t/admin-$GITHUB_REF + git commit -m "Updating admin-service to ${{ github.sha }}" # This token is an account wide token which allows creation of PRs and pushes. echo "${{ secrets.MODULE_PR_TOKEN }}" > token.txt gh auth login --with-token < token.txt - gh pr create \ - --title "Update ${{ needs.detect-repo-owner.outputs.branch }} Admin Interface to $GITHUB_REF" \ - --body "Updating Opencast ${{ needs.detect-repo-owner.outputs.branch }} Admin Interface module to [$GITHUB_REF](https://github.com/${{ github.repository_owner }}/admin-interface/commit/$GITHUB_REF)" \ - --head=${{ github.repository_owner }}:t/admin-$GITHUB_REF \ - --base ${{ github.ref_name }} \ - -R ${{ github.repository_owner }}/opencast - #FIXME: fine grained PATs can't apply labels - #FIXME: classic PATs don't have the permissions because the PR isn't in an opencastproject (the user) repo - #--label admin-ui --label maintenance \ + export CURRENT_PR=$(gh pr list -R ${{ github.repository_owner }}/opencast --head t/admin-${{ github.ref_name }} --json number --jq '.[].number') + if [ -n "$CURRENT_PR" ]; then + gh pr edit $CURRENT_PR \ + --body "Updating Opencast ${{ needs.detect-repo-owner.outputs.branch }} Admin Interface module to [${{ github.sha }}](https://github.com/${{ github.repository_owner }}/admin-interface/commit/${{ github.sha }})" \ + -R ${{ github.repository_owner }}/opencast + git push origin t/admin-${{ github.ref_name }} --force + else + gh pr create \ + --title "Update ${{ needs.detect-repo-owner.outputs.branch }} Admin Interface" \ + --body "Updating Opencast ${{ needs.detect-repo-owner.outputs.branch }} Admin Interface module to [${{ github.sha }}](https://github.com/${{ github.repository_owner }}/admin-interface/commit/${{ github.sha }})" \ + --head=${{ github.repository_owner }}:t/admin-${{ github.ref_name }} \ + --base ${{ github.ref_name }} \ + -R ${{ github.repository_owner }}/opencast + #FIXME: fine grained PATs can't apply labels + #FIXME: classic PATs don't have the permissions because the PR isn't in an opencastproject (the user) repo + #--label admin-ui --label maintenance \ + fi From 4148112b4f9ac0b47ad31a41991662aa11d1ec80 Mon Sep 17 00:00:00 2001 From: Greg Logan Date: Thu, 2 Apr 2026 10:54:52 -0600 Subject: [PATCH 2/5] Cleaning up branch names so they're more sane --- .github/workflows/deploy-main-branches.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy-main-branches.yml b/.github/workflows/deploy-main-branches.yml index e9cc15000b..d778b53b33 100644 --- a/.github/workflows/deploy-main-branches.yml +++ b/.github/workflows/deploy-main-branches.yml @@ -126,7 +126,7 @@ jobs: run: | git clone -b ${{ github.ref_name }} "git@github.com:${{ github.repository_owner }}/opencast.git" opencast cd opencast - git checkout -b t/admin-${{ github.ref_name }} + git checkout -b t/admin-${{ needs.detect-repo-owner.outputs.branch }} - name: Update the admin submodule working-directory: opencast @@ -141,17 +141,17 @@ jobs: # This token is an account wide token which allows creation of PRs and pushes. echo "${{ secrets.MODULE_PR_TOKEN }}" > token.txt gh auth login --with-token < token.txt - export CURRENT_PR=$(gh pr list -R ${{ github.repository_owner }}/opencast --head t/admin-${{ github.ref_name }} --json number --jq '.[].number') + export CURRENT_PR=$(gh pr list -R ${{ github.repository_owner }}/opencast --head t/admin-${{ needs.detect-repo-owner.outputs.branch }} --json number --jq '.[].number') if [ -n "$CURRENT_PR" ]; then gh pr edit $CURRENT_PR \ --body "Updating Opencast ${{ needs.detect-repo-owner.outputs.branch }} Admin Interface module to [${{ github.sha }}](https://github.com/${{ github.repository_owner }}/admin-interface/commit/${{ github.sha }})" \ -R ${{ github.repository_owner }}/opencast - git push origin t/admin-${{ github.ref_name }} --force + git push origin t/admin-${{ needs.detect-repo-owner.outputs.branch }} --force else gh pr create \ --title "Update ${{ needs.detect-repo-owner.outputs.branch }} Admin Interface" \ --body "Updating Opencast ${{ needs.detect-repo-owner.outputs.branch }} Admin Interface module to [${{ github.sha }}](https://github.com/${{ github.repository_owner }}/admin-interface/commit/${{ github.sha }})" \ - --head=${{ github.repository_owner }}:t/admin-${{ github.ref_name }} \ + --head=${{ github.repository_owner }}:t/admin-${{ needs.detect-repo-owner.outputs.branch }} \ --base ${{ github.ref_name }} \ -R ${{ github.repository_owner }}/opencast #FIXME: fine grained PATs can't apply labels From 1fa6e1957b3b787fbaee473e2cfd89565a4b07a8 Mon Sep 17 00:00:00 2001 From: Greg Logan Date: Thu, 2 Apr 2026 11:30:18 -0600 Subject: [PATCH 3/5] Branch must be pushed prior to gh usage --- .github/workflows/deploy-main-branches.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-main-branches.yml b/.github/workflows/deploy-main-branches.yml index d778b53b33..aa27a44d5b 100644 --- a/.github/workflows/deploy-main-branches.yml +++ b/.github/workflows/deploy-main-branches.yml @@ -142,11 +142,11 @@ jobs: echo "${{ secrets.MODULE_PR_TOKEN }}" > token.txt gh auth login --with-token < token.txt export CURRENT_PR=$(gh pr list -R ${{ github.repository_owner }}/opencast --head t/admin-${{ needs.detect-repo-owner.outputs.branch }} --json number --jq '.[].number') + git push origin t/admin-${{ needs.detect-repo-owner.outputs.branch }} --force if [ -n "$CURRENT_PR" ]; then gh pr edit $CURRENT_PR \ --body "Updating Opencast ${{ needs.detect-repo-owner.outputs.branch }} Admin Interface module to [${{ github.sha }}](https://github.com/${{ github.repository_owner }}/admin-interface/commit/${{ github.sha }})" \ -R ${{ github.repository_owner }}/opencast - git push origin t/admin-${{ needs.detect-repo-owner.outputs.branch }} --force else gh pr create \ --title "Update ${{ needs.detect-repo-owner.outputs.branch }} Admin Interface" \ From 9082ca89a8b036ef619e2ac9cb78b91f69e0a23f Mon Sep 17 00:00:00 2001 From: Greg Logan Date: Thu, 2 Apr 2026 14:32:57 -0600 Subject: [PATCH 4/5] Correcting module in use --- .github/workflows/deploy-main-branches.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-main-branches.yml b/.github/workflows/deploy-main-branches.yml index aa27a44d5b..5d534437d0 100644 --- a/.github/workflows/deploy-main-branches.yml +++ b/.github/workflows/deploy-main-branches.yml @@ -135,8 +135,8 @@ jobs: # and we don't have a guarantee that the update triggered by commit A does not end up finding commit B # We are going to ignore this possibility since we almost universally want the *latest* commit, though this # could end up causing the commit message, and the actual submodule hash to differ. - git submodule update --init --remote modules/admin-ui - git add modules/admin-ui + git submodule update --init --remote modules/admin + git add modules/admin git commit -m "Updating admin-service to ${{ github.sha }}" # This token is an account wide token which allows creation of PRs and pushes. echo "${{ secrets.MODULE_PR_TOKEN }}" > token.txt From 51cf6252d809a1e472f863c5efcee31188ef76a3 Mon Sep 17 00:00:00 2001 From: Greg Logan Date: Thu, 2 Apr 2026 16:21:38 -0600 Subject: [PATCH 5/5] Fixing typo in PR deploy workflow --- .github/workflows/pr-deploy-test-branch.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-deploy-test-branch.yml b/.github/workflows/pr-deploy-test-branch.yml index 3eb024cec0..7a272e52da 100644 --- a/.github/workflows/pr-deploy-test-branch.yml +++ b/.github/workflows/pr-deploy-test-branch.yml @@ -89,7 +89,7 @@ jobs: - name: Clone repository run: | - git clone -b gh-pages "git@github.com:${{ github.repository_owner }}/-admin-interface-test.git" admin-interface-test + git clone -b gh-pages "git@github.com:${{ github.repository_owner }}/admin-interface-test.git" admin-interface-test - name: Store build in the clone env: