Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions .github/workflows/ado-pipeline-yaml-pr-warning.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Warn when ADO pipeline YAML file changes

on:
pull_request:
paths:
- ".azdo/ci-pr.yaml"

permissions:
contents: read
pull-requests: write

jobs:
warn:
runs-on: ubuntu-latest
steps:
- name: Emit warning in logs
run: |
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."

echo "ADO pipeline: DV-Python-SDK-PullRequest (definitionId=29922)"
echo "https://dev.azure.com/dynamicscrm/OneCRM/_build?definitionId=29922"

- name: Add workflow summary
run: |
{
echo "## ADO PR pipeline YAML change detected"
echo ""
echo "**File changed:** \`.azdo/ci-pr.yaml\`"
echo ""
echo "**Why this matters:** After this is merged, Azure DevOps may disable/require approval for the PR pipeline YAML."
echo ""
echo "**Action required (post-merge):** Re-enable / approve the updated YAML for:"
echo "- **DV-Python-SDK-PullRequest** (definitionId=29922)"
echo "- https://dev.azure.com/dynamicscrm/OneCRM/_build?definitionId=29922"
echo ""
echo "Then trigger a run to confirm PR validation works."
} >> "$GITHUB_STEP_SUMMARY"

- name: Post resolvable PR review comment
env:
GH_TOKEN: ${{ github.token }}
run: |
jq -n \
--arg sha "${{ github.event.pull_request.head.sha }}" \
'{
path: ".azdo/ci-pr.yaml",
subject_type: "file",
commit_id: $sha,
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."
}' | \
gh api \
--method POST \
-H "Accept: application/vnd.github+json" \
/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/comments \
--input -