Skip to content

Commit ee6ab06

Browse files
committed
pull-request-formatting-validator: Validate file sync PR titles
The default file sync PR title is not useful in source history. This check ensures the title is updated to reflect the actual file sync changes. Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
1 parent fcb116a commit ee6ab06

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

.github/workflows/pull-request-formatting-validator.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,13 @@ jobs:
5252
echo 'VALIDATION_ERROR=true' >> $GITHUB_ENV
5353
fi
5454
55+
if [[ "${prTitle}" == "Repo File Sync: synced file(s) with microsoft/mu_devops" ]]; then
56+
if ! echo "${comments}" | grep -qF '<!-- pr-val-sync-title -->'; then
57+
gh pr comment $PR_URL --body "<!-- pr-val-sync-title -->⚠️ Please add a meaningful PR title (update the default file sync title)."
58+
fi
59+
echo 'VALIDATION_ERROR=true' >> $GITHUB_ENV
60+
fi
61+
5562
env:
5663
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
5764
OWNER: ${{ github.repository_owner }}

.sync/workflows/leaf/pull-request-formatting-validator.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,13 @@ jobs:
5252
echo 'VALIDATION_ERROR=true' >> $GITHUB_ENV
5353
fi
5454
55+
if [[ "${prTitle}" == "Repo File Sync: synced file(s) with microsoft/mu_devops" ]]; then
56+
if ! echo "${comments}" | grep -qF '<!-- pr-val-sync-title -->'; then
57+
gh pr comment $PR_URL --body "<!-- pr-val-sync-title -->⚠️ Please add a meaningful PR title (update the default file sync title)."
58+
fi
59+
echo 'VALIDATION_ERROR=true' >> $GITHUB_ENV
60+
fi
61+
5562
env:
5663
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
5764
OWNER: ${{ github.repository_owner }}

0 commit comments

Comments
 (0)