Skip to content

Commit 6dcbfc7

Browse files
authored
ci: conventional commits aws#5486
Problem: `lint-commits` job does not trigger if contributor updates the PR title. Solution: - Specify `on.pull_request.types` to include `edited` event. - Skip `edited` event for all jobs except `lint-commits`. Reference: - https://github.com/orgs/community/discussions/48695 - https://github.com/orgs/community/discussions/101695 - https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#pull_request - https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=edited#pull_request
1 parent 4337e05 commit 6dcbfc7

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

.github/workflows/node.js.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# github actions: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
1+
# github actions: https://docs.github.com/en/actions/use-cases-and-examples/building-and-testing/building-and-testing-nodejs
22
# setup-node: https://github.com/actions/setup-node
33

44
name: CI
@@ -8,6 +8,19 @@ on:
88
branches: [master]
99
pull_request:
1010
branches: [master, feature/*, mynah-dev]
11+
# Default = opened + synchronize + reopened.
12+
# We also want "edited" so that lint-commits runs when PR title is updated.
13+
# https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#pull_request
14+
types:
15+
- edited
16+
- opened
17+
- reopened
18+
- synchronize
19+
20+
# Cancel old jobs when a pull request is updated.
21+
concurrency:
22+
group: ${{ github.head_ref || github.run_id }}
23+
cancel-in-progress: true
1124

1225
jobs:
1326
lint-commits:

0 commit comments

Comments
 (0)