Skip to content

Commit 9e425af

Browse files
authored
ci: condense messages, clarify "changelog" message #5908
Problem: - Contributors get confused about when to add a changelog. - Bot adds two comments which could be combined into one comment. Solution: - Clarify the changelog note. - Combine messages into one comment.
1 parent 6605489 commit 9e425af

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

.github/workflows/notification.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
if: github.event_name == 'pull_request_target'
3838
with:
3939
node-version: '20'
40-
- name: Check for tests
40+
- name: Comment about contribution guidelines
4141
uses: actions/github-script@v7
4242
if: github.event_name == 'pull_request_target'
4343
with:

.github/workflows/notify.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@
66
const { hasPath, dedupComment } = require('./utils')
77

88
const testFilesMessage =
9-
'This pull request modifies code in src/ but no tests were added/updated. Confirm whether tests should be added or ensure the PR description explains why tests are not required.'
9+
'- This pull request modifies code in `src/*` but no tests were added/updated.\n - Confirm whether tests should be added or ensure the PR description explains why tests are not required.\n'
1010

11-
const changelogMessage = `This pull request implements a feature or fix, so it must include a changelog entry. See [CONTRIBUTING.md#changelog](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#changelog) for instructions.`
11+
const changelogMessage =
12+
'- This pull request implements a `feat` or `fix`, so it must include a changelog entry (unless the fix is for an *unreleased* feature). Review the [changelog guidelines](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#changelog).\n - Note: beta or "experiment" features that have active users *should* announce fixes in the changelog.\n - If this is not a feature or fix, use an appropriate type from the [title guidelines](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#pull-request-title). For example, telemetry-only changes should use the `telemetry` type.\n'
1213

1314
/**
1415
* Remind partner teams that tests are required. We don't need to remind them if:
@@ -44,12 +45,16 @@ module.exports = async ({ github, context }) => {
4445
issue_number: pullRequestId,
4546
})
4647

48+
let msg = ''
4749
if (shouldAddTestFileMessage) {
48-
await dedupComment({ github, comments, owner, repo, pullRequestId, message: testFilesMessage })
50+
msg += testFilesMessage
4951
}
50-
5152
if (shouldAddChangelogMessage) {
52-
await dedupComment({ github, comments, owner, repo, pullRequestId, message: changelogMessage })
53+
msg += changelogMessage
54+
}
55+
56+
if (shouldAddTestFileMessage || shouldAddChangelogMessage) {
57+
await dedupComment({ github, comments, owner, repo, pullRequestId, message: msg })
5358
}
5459
}
5560

0 commit comments

Comments
 (0)