Skip to content

Commit 1b7041d

Browse files
authored
Merge pull request #267 from aws/jpinkney-aws/foo
fix(ci): test
2 parents 3dbac9c + 5455337 commit 1b7041d

File tree

4 files changed

+7
-32
lines changed

4 files changed

+7
-32
lines changed

.github/workflows/lintcommit.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ function validateTitle(title) {
8888
} else if (subject.length === 0) {
8989
return 'empty subject'
9090
} else if (subject.length > 100) {
91-
return 'invalid subject (must be <=100 chars)'
91+
return 'invalid subject2 (must be <=100 chars)'
9292
}
9393

9494
return undefined

.github/workflows/notification.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
name: Notifications
55

66
on:
7-
push:
8-
branches: [master, staging]
97
pull_request_target:
108
branches: [master, feature/*, staging]
119
# Default = opened + synchronize + reopened.
@@ -19,14 +17,15 @@ on:
1917

2018
# Cancel old jobs when a pull request is updated.
2119
concurrency:
22-
group: ${{ github.head_ref || github.run_id }}
20+
group: ${{ github.workflow }}-${{ github.ref }}
2321
cancel-in-progress: true
2422

2523
jobs:
2624
lint-commits:
2725
runs-on: ubuntu-latest
2826
permissions:
2927
pull-requests: write
28+
issues: read
3029
steps:
3130
- uses: actions/checkout@v4
3231
with:

.github/workflows/notify.js

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6-
const { parsePRTitle, hasPath, dedupComment } = require('./utils')
6+
const { parsePRTitle, hasPath } = require('./utils')
77

88
const testFilesMessage =
99
'This pull request modifies files 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.'
@@ -21,7 +21,6 @@ module.exports = async ({ github, context }) => {
2121
const owner = context.repo.owner
2222
const repo = context.repo.repo
2323
const author = context.payload.pull_request.head.repo.owner.login
24-
const pullRequestId = context.payload.pull_request.number
2524

2625
const response = await github.rest.repos.compareCommitsWithBasehead({
2726
owner,
@@ -38,19 +37,13 @@ module.exports = async ({ github, context }) => {
3837
return
3938
}
4039

41-
// Check for prior comments on the PR
42-
const comments = await github.rest.issues.listComments({
43-
owner,
44-
repo,
45-
issue_number: pullRequestId,
46-
})
47-
4840
if (shouldAddTestFileMessage) {
49-
await dedupComment({ github, comments, owner, repo, pullRequestId, message: testFilesMessage })
41+
// We can't really block on this one, since its valid to make a change in src/ without adding tests :( console.error(testFilesMessage)
5042
}
5143

5244
if (shouldAddChangelogMessage) {
53-
await dedupComment({ github, comments, owner, repo, pullRequestId, message: changelogMessage })
45+
console.error(changelogMessage)
46+
process.exit(1)
5447
}
5548
}
5649

.github/workflows/utils.js

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,6 @@ function parsePRTitle(title) {
2525
}
2626
}
2727

28-
/**
29-
* Create a comment on a PR if one does not already exist
30-
*/
31-
async function dedupComment({ github, pullRequestId, owner, repo, comments, message }) {
32-
if (comments.data.some((comment) => comment.body.includes(message))) {
33-
return
34-
}
35-
36-
await github.rest.issues.createComment({
37-
issue_number: pullRequestId,
38-
owner,
39-
repo,
40-
body: message,
41-
})
42-
}
43-
4428
/*
4529
* Check if path is included in at least one of the filename paths
4630
*/
@@ -50,6 +34,5 @@ function hasPath(filenames, path) {
5034

5135
module.exports = {
5236
parsePRTitle,
53-
dedupComment,
5437
hasPath,
5538
}

0 commit comments

Comments
 (0)