Skip to content

Commit 0919364

Browse files
committed
misc: add a label to prevent submodule trigger
1 parent cf7c3f3 commit 0919364

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

.github/workflows/triggers.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,20 @@ jobs:
2222
repository: devitocodes/devitoproject.org
2323
event-type: deploy-docs
2424

25+
# Detect whether the PR merged into main carried the "no-pro-trigger"
26+
# label. When present, the pro submodule update is skipped so devitopro
27+
# PRs pinned to a specific branch don't have to be closed by hand.
28+
- name: Check for no-pro-trigger label
29+
id: pro_label
30+
env:
31+
GH_TOKEN: ${{ github.token }}
32+
run: |
33+
skip=$(gh api "repos/${{ github.repository }}/commits/${{ github.sha }}/pulls" \
34+
--jq 'any(.[].labels[]; .name == "no-pro-trigger")')
35+
echo "skip=$skip" >> "$GITHUB_OUTPUT"
36+
2537
- name: Trigger pro submodule update
38+
if: steps.pro_label.outputs.skip != 'true'
2639
uses: peter-evans/repository-dispatch@v4
2740
with:
2841
token: ${{ secrets.PRO_SUBMODULE }}

0 commit comments

Comments
 (0)