Skip to content

Commit b886e92

Browse files
committed
ci: editing PR description re-triggers all GitHub Actions
Problem: The `lint-commits` job runs whenever the PR description is edited, which then re-runs all the other GHA jobs. This is because it listens to the `edited` event (6dcbfc7) Solution: Make the `lint-commits` job conditional on `github.event.changes.title`.
1 parent 8708c52 commit b886e92

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

.github/workflows/node.js.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ on:
99
pull_request:
1010
branches: [master, feature/*, staging]
1111
# Default = opened + synchronize + reopened.
12-
# We also want "edited" so that lint-commits runs when PR title is updated.
12+
# We also want `edited` so that `lint-commits` runs when PR title is updated (see
13+
# `github.event.changes.title` condition below).
1314
# https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#pull_request
1415
types:
1516
- edited
@@ -24,6 +25,8 @@ concurrency:
2425

2526
jobs:
2627
lint-commits:
28+
# Trigger only on PR creation or if the title (not description, etc.) is edited.
29+
if: ${{ github.event_name != 'pull_request' || github.event.action != 'edited' || github.event.changes.title }}
2730
runs-on: ubuntu-latest
2831
steps:
2932
- uses: actions/checkout@v4

0 commit comments

Comments
 (0)