Skip to content

Commit 82440d8

Browse files
Copilotsaurabhrb
andcommitted
Add resolvable PR review comment step for ADO pipeline YAML warning
Co-authored-by: saurabhrb <32964911+saurabhrb@users.noreply.github.com>
1 parent f5fd2ab commit 82440d8

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

.github/workflows/ado-pipeline-yaml-pr-warning.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77

88
permissions:
99
contents: read
10+
pull-requests: write
1011

1112
jobs:
1213
warn:
@@ -34,3 +35,21 @@ jobs:
3435
echo ""
3536
echo "Then trigger a run to confirm PR validation works."
3637
} >> "$GITHUB_STEP_SUMMARY"
38+
39+
- name: Post resolvable PR review comment
40+
env:
41+
GH_TOKEN: ${{ github.token }}
42+
run: |
43+
jq -n \
44+
--arg sha "${{ github.event.pull_request.head.sha }}" \
45+
'{
46+
path: ".azdo/ci-pr.yaml",
47+
subject_type: "file",
48+
commit_id: $sha,
49+
body: "> [!WARNING]\n> **ADO PR pipeline YAML change detected**\n>\n> This PR modifies `.azdo/ci-pr.yaml`. After merge, Azure DevOps may disable or require approval for the PR validation pipeline.\n>\n> **Action required (post-merge):** Re-enable / approve the updated YAML for:\n> - **DV-Python-SDK-PullRequest** (definitionId=29922)\n> - https://dev.azure.com/dynamicscrm/OneCRM/_build?definitionId=29922\n>\n> Please resolve this comment after completing the post-merge steps."
50+
}' | \
51+
gh api \
52+
--method POST \
53+
-H "Accept: application/vnd.github+json" \
54+
/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/comments \
55+
--input -

0 commit comments

Comments
 (0)