fix: dont nag maintainers when nothing needs to be done

This commit is contained in:
KazWolfe 2025-09-29 14:21:17 -07:00 committed by GitHub
parent 7813f5d201
commit 4c64249e97
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -41,6 +41,7 @@ jobs:
git config --global user.email noreply@github.com git config --global user.email noreply@github.com
git config --global pull.rebase false git config --global pull.rebase false
- name: Update submodule - name: Update submodule
id: update-submodule
run: | run: |
git checkout -b ${{ matrix.submodule.branch-prefix }}-${{ matrix.branches }} git checkout -b ${{ matrix.submodule.branch-prefix }}-${{ matrix.branches }}
git reset --hard origin/${{ matrix.branches }} git reset --hard origin/${{ matrix.branches }}
@ -50,8 +51,14 @@ jobs:
cd ../.. cd ../..
git add ${{ matrix.submodule.path }} git add ${{ matrix.submodule.path }}
git commit --message "Update ${{ matrix.submodule.name }}" git commit --message "Update ${{ matrix.submodule.name }}"
git push origin ${{ matrix.submodule.branch-prefix }}-${{ matrix.branches }} --force if [ $? -eq 0 ]; then
git push origin ${{ matrix.submodule.branch-prefix }}-${{ matrix.branches }} --force
echo "SUBMIT_PR=true" >> "$GITHUB_OUTPUT"
else
echo "SUBMIT_PR=false" >> "$GITHUB_OUTPUT"
fi
- name: Create PR - name: Create PR
if: ${{ steps.update-submodule.outputs.SUBMIT_PR == "true" }}
run: | run: |
echo ${{ secrets.UPDATE_PAT }} | gh auth login --with-token echo ${{ secrets.UPDATE_PAT }} | gh auth login --with-token
prNumber=$(gh pr list --base ${{ matrix.branches }} --head ${{ matrix.submodule.branch-prefix }}-${{ matrix.branches }} --state open --json number --template "{{range .}}{{.number}}{{end}}") prNumber=$(gh pr list --base ${{ matrix.branches }} --head ${{ matrix.submodule.branch-prefix }}-${{ matrix.branches }} --state open --json number --template "{{range .}}{{.number}}{{end}}")