Skip to content

Commit 05870b6

Browse files
mario-camposCopilot
andcommitted
Defer workflow activation to a follow-up PR
Keep the post-comment implementation independent of the workflow that loads it from main. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent 9d1378f commit 05870b6

1 file changed

Lines changed: 2 additions & 73 deletions

File tree

‎.github/workflows/pr-checks.yml‎

Lines changed: 2 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,6 @@ jobs:
9595
contents: read
9696
runs-on: ubuntu-latest
9797
timeout-minutes: 10
98-
outputs:
99-
changelog-modified: ${{ steps.changelog-check.outputs.modified }}
10098

10199
concurrency:
102100
cancel-in-progress: ${{ github.event_name == 'pull_request' || false }}
@@ -185,20 +183,6 @@ jobs:
185183
path: ${{ runner.temp }}/repo-size/
186184
if-no-files-found: error
187185

188-
- name: Check for CHANGELOG.md changes
189-
id: changelog-check
190-
if: steps.fetch-base.outcome == 'success'
191-
env:
192-
BASE_SHA: ${{ steps.fetch-base.outputs.merge_base }}
193-
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
194-
run: |
195-
if ! git diff --exit-code --quiet "$BASE_SHA" "$HEAD_SHA" -- CHANGELOG.md; then
196-
echo "CHANGELOG.md was modified in this PR."
197-
echo "modified=true" >> "$GITHUB_OUTPUT"
198-
else
199-
echo "modified=false" >> "$GITHUB_OUTPUT"
200-
fi
201-
202186
- name: "Backport: Check out base ref"
203187
id: checkout-base
204188
if: ${{ startsWith(github.head_ref, 'backport-') }}
@@ -219,8 +203,8 @@ jobs:
219203
exit 1
220204
fi
221205
222-
post-pr-comments:
223-
name: Post PR comments
206+
post-repo-size-comment:
207+
name: Post repo size comment
224208
needs: other-checks
225209
# Keep write permissions isolated from the job that checks out and tests PR code. This job only
226210
# posts the candidate comment body produced by the read-only `pr-checks` job.
@@ -240,22 +224,6 @@ jobs:
240224
group: check-repo-size-${{ github.event.pull_request.number }}
241225

242226
steps:
243-
- name: Checkout repository
244-
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
245-
with:
246-
# Check out main, not the PR's head, since this job runs with
247-
# `pull-requests: write` permissions and must not execute untrusted code from the PR.
248-
ref: main
249-
250-
- name: Set up Node.js
251-
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
252-
with:
253-
node-version: 24
254-
cache: "npm"
255-
256-
- name: Install dependencies
257-
run: npm ci --workspace=pr-checks
258-
259227
- name: Download repo size comment
260228
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
261229
with:
@@ -285,42 +253,3 @@ jobs:
285253
else
286254
echo "Skipping repo size comment because the delta is below the threshold and no sticky comment exists."
287255
fi
288-
289-
- name: Post a warning about modifying CHANGELOG.md
290-
# Release, backport, mergeback, and bundle-update PRs deliberately modify CHANGELOG.md,
291-
# so skip comment management entirely for these automation flows.
292-
if: >-
293-
needs.other-checks.outputs.changelog-modified == 'true' &&
294-
!startsWith(github.event.pull_request.head.ref, 'update-v') &&
295-
!startsWith(github.event.pull_request.head.ref, 'backport-v') &&
296-
!startsWith(github.event.pull_request.head.ref, 'mergeback/') &&
297-
!startsWith(github.event.pull_request.head.ref, 'update-bundle/')
298-
uses: ./.github/actions/post-comment
299-
with:
300-
marker: "post-comment:CHANGELOG.md"
301-
body: |
302-
⚠️ `CHANGELOG.md` has been modified in this PR. Please do not modify `CHANGELOG.md` directly.
303-
Instead, create a change-note file in `unreleased-change-notes/`. The `CHANGELOG.md`
304-
file will be automatically generated from those change-notes.
305-
See [`unreleased-change-notes/README.md`](https://github.com/github/codeql-action/blob/main/unreleased-change-notes/README.md) for more information.
306-
token: ${{ secrets.GITHUB_TOKEN }}
307-
308-
- name: Mark the CHANGELOG.md concern as resolved
309-
if: >-
310-
needs.other-checks.outputs.changelog-modified == 'false' &&
311-
!startsWith(github.event.pull_request.head.ref, 'update-v') &&
312-
!startsWith(github.event.pull_request.head.ref, 'backport-v') &&
313-
!startsWith(github.event.pull_request.head.ref, 'mergeback/') &&
314-
!startsWith(github.event.pull_request.head.ref, 'update-bundle/')
315-
uses: ./.github/actions/post-comment
316-
with:
317-
marker: "post-comment:CHANGELOG.md"
318-
update-only: true
319-
body: |
320-
⚠️ `CHANGELOG.md` has been modified in this PR. Please do not modify `CHANGELOG.md` directly.
321-
Instead, create a change-note file in `unreleased-change-notes/`. The `CHANGELOG.md`
322-
file will be automatically generated from those change-notes.
323-
See [`unreleased-change-notes/README.md`](https://github.com/github/codeql-action/blob/main/unreleased-change-notes/README.md) for more information.
324-
325-
**Edit:** `CHANGELOG.md` is no longer modified in this PR. This concern is resolved.
326-
token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)