@@ -13,6 +13,7 @@ concurrency:
1313
1414jobs :
1515 detect-repo-owner :
16+ name : Detect branch and appropriate server
1617 if : github.repository_owner == 'opencast'
1718 runs-on : ubuntu-latest
1819 outputs :
3637
3738
3839 deploy-main-branches :
40+ name : Deploy admin-interface.opencast.org
3941 runs-on : ubuntu-latest
4042 needs : detect-repo-owner
4143 steps :
@@ -124,7 +126,7 @@ jobs:
124126 run : |
125127 git clone -b ${{ github.ref_name }} "git@github.com:${{ github.repository_owner }}/opencast.git" opencast
126128 cd opencast
127- git checkout -b t/admin-$GITHUB_REF
129+ git checkout -b t/admin-${{ needs.detect-repo-owner.outputs.branch }}
128130
129131 - name : Update the admin submodule
130132 working-directory : opencast
@@ -133,19 +135,26 @@ jobs:
133135 # and we don't have a guarantee that the update triggered by commit A does not end up finding commit B
134136 # We are going to ignore this possibility since we almost universally want the *latest* commit, though this
135137 # could end up causing the commit message, and the actual submodule hash to differ.
136- git submodule update --init --remote modules/admin-ui
137- git add modules/admin-ui
138- git commit -m "Updating admin-service to $GITHUB_REF"
139- git push origin t/admin-$GITHUB_REF
138+ git submodule update --init --remote modules/admin
139+ git add modules/admin
140+ git commit -m "Updating admin-service to ${{ github.sha }}"
140141 # This token is an account wide token which allows creation of PRs and pushes.
141142 echo "${{ secrets.MODULE_PR_TOKEN }}" > token.txt
142143 gh auth login --with-token < token.txt
143- gh pr create \
144- --title "Update ${{ needs.detect-repo-owner.outputs.branch }} Admin Interface to $GITHUB_REF" \
145- --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)" \
146- --head=${{ github.repository_owner }}:t/admin-$GITHUB_REF \
147- --base ${{ github.ref_name }} \
148- -R ${{ github.repository_owner }}/opencast
149- #FIXME: fine grained PATs can't apply labels
150- #FIXME: classic PATs don't have the permissions because the PR isn't in an opencastproject (the user) repo
151- #--label admin-ui --label maintenance \
144+ export CURRENT_PR=$(gh pr list -R ${{ github.repository_owner }}/opencast --head t/admin-${{ needs.detect-repo-owner.outputs.branch }} --json number --jq '.[].number')
145+ git push origin t/admin-${{ needs.detect-repo-owner.outputs.branch }} --force
146+ if [ -n "$CURRENT_PR" ]; then
147+ gh pr edit $CURRENT_PR \
148+ --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 }})" \
149+ -R ${{ github.repository_owner }}/opencast
150+ else
151+ gh pr create \
152+ --title "Update ${{ needs.detect-repo-owner.outputs.branch }} Admin Interface" \
153+ --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 }})" \
154+ --head=${{ github.repository_owner }}:t/admin-${{ needs.detect-repo-owner.outputs.branch }} \
155+ --base ${{ github.ref_name }} \
156+ -R ${{ github.repository_owner }}/opencast
157+ #FIXME: fine grained PATs can't apply labels
158+ #FIXME: classic PATs don't have the permissions because the PR isn't in an opencastproject (the user) repo
159+ #--label admin-ui --label maintenance \
160+ fi
0 commit comments