Skip to content

Commit

Permalink
ci: editing PR description re-triggers all GitHub Actions #6274
Browse files Browse the repository at this point in the history
Problem:
Since 6dcbfc7, 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, which triggers whenever the
PR is edited in any way (very noisy).

Solution:
There is no way to avoid rerunning all the CI jobs if they are dependent
on `lint-commits`. Instead, revert 6dcbfc7 and document that
re-opening the PR will force CI to re-run, if needed, after fixing a PR
title.
  • Loading branch information
justinmk3 authored Dec 18, 2024
1 parent 8708c52 commit ab937e4
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 18 deletions.
3 changes: 1 addition & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@

- Treat all work as PUBLIC. Private `feature/x` branches will not be squash-merged at release time.
- Your code changes must meet the guidelines in [CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines).

License: I confirm that my contribution is made under the terms of the Apache 2.0 license.
- License: I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 change: 1 addition & 0 deletions .github/workflows/lintcommit.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ Invalid pull request title: \`${title}\`
* scope: lowercase, <30 chars
* subject: must be <100 chars
* documentation: https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#pull-request-title
* Hint: *close and re-open the PR* to re-trigger CI (after fixing the PR title).
`
: `Pull request title matches the [expected format](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#pull-request-title).`

Expand Down
12 changes: 4 additions & 8 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,10 @@ on:
push:
branches: [master, staging]
pull_request:
branches: [master, feature/*, staging]
# Default = opened + synchronize + reopened.
# We also want "edited" so that lint-commits runs when PR title is updated.
# By default, CI will trigger on opened/synchronize/reopened event types.
# https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#pull_request
types:
- edited
- opened
- reopened
- synchronize
# Note: To re-run `lint-commits` after fixing the PR title, close-and-reopen the PR.
branches: [master, feature/*, staging]

# Cancel old jobs when a pull request is updated.
concurrency:
Expand All @@ -24,6 +19,7 @@ concurrency:

jobs:
lint-commits:
# Note: To re-run `lint-commits` after fixing the PR title, close-and-reopen the PR.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down
11 changes: 3 additions & 8 deletions .github/workflows/notification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,10 @@ name: Notifications
on:
# `pull_request_target` (as opposed to `pull_request`) gives permissions to comment on PRs.
pull_request_target:
branches: [master, feature/*, staging]
# Default = opened + synchronize + reopened.
# We also want "edited" so that changelog notifications runs when PR title is updated.
# By default, CI will trigger on opened/synchronize/reopened event types.
# https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#pull_request
types:
- edited
- opened
- reopened
- synchronize
# Note: To re-run `lint-commits` after fixing the PR title, close-and-reopen the PR.
branches: [master, feature/*, staging]

# Cancel old jobs when a pull request is updated.
concurrency:
Expand Down

0 comments on commit ab937e4

Please sign in to comment.