Skip to content

Commit c1ca6f4

Browse files
Merge branch 'main' into chore/single-version-source
2 parents 08a0e23 + 6a3cb1b commit c1ca6f4

1 file changed

Lines changed: 55 additions & 0 deletions

File tree

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Warn when ADO pipeline YAML file changes
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- ".azdo/ci-pr.yaml"
7+
8+
permissions:
9+
contents: read
10+
pull-requests: write
11+
12+
jobs:
13+
warn:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Emit warning in logs
17+
run: |
18+
echo "::warning file=.azdo/ci-pr.yaml::This PR changes .azdo/ci-pr.yaml. After merge, Azure DevOps may disable/require approval for the PR pipeline YAML until it is re-enabled/approved."
19+
20+
echo "ADO pipeline: DV-Python-SDK-PullRequest (definitionId=29922)"
21+
echo "https://dev.azure.com/dynamicscrm/OneCRM/_build?definitionId=29922"
22+
23+
- name: Add workflow summary
24+
run: |
25+
{
26+
echo "## ADO PR pipeline YAML change detected"
27+
echo ""
28+
echo "**File changed:** \`.azdo/ci-pr.yaml\`"
29+
echo ""
30+
echo "**Why this matters:** After this is merged, Azure DevOps may disable/require approval for the PR pipeline YAML."
31+
echo ""
32+
echo "**Action required (post-merge):** Re-enable / approve the updated YAML for:"
33+
echo "- **DV-Python-SDK-PullRequest** (definitionId=29922)"
34+
echo "- https://dev.azure.com/dynamicscrm/OneCRM/_build?definitionId=29922"
35+
echo ""
36+
echo "Then trigger a run to confirm PR validation works."
37+
} >> "$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)