From 667c2e9798a2de22042beed1b60188e18bf5e90f Mon Sep 17 00:00:00 2001 From: Connor Tumbleson Date: Sat, 17 Jan 2026 08:39:23 -0500 Subject: [PATCH 01/10] chore: add handling around failed gh calls (#170) --- .../src/main.ts | 104 +++++++++++------- 1 file changed, 63 insertions(+), 41 deletions(-) diff --git a/communicate-on-pull-request-released/src/main.ts b/communicate-on-pull-request-released/src/main.ts index 1821467..7a5de6f 100644 --- a/communicate-on-pull-request-released/src/main.ts +++ b/communicate-on-pull-request-released/src/main.ts @@ -61,30 +61,40 @@ export async function run() { } async function addCommentToPullRequest(client: Octokit, prNumber: number, comment: string) { - await client.rest.pulls.createReview({ - owner: github.context.repo.owner, - repo: github.context.repo.repo, - pull_number: prNumber, - body: comment, - event: 'COMMENT' - }); + try { + await client.rest.pulls.createReview({ + owner: github.context.repo.owner, + repo: github.context.repo.repo, + pull_number: prNumber, + body: comment, + event: 'COMMENT' + }); + } catch (error) { + console.log(`Failed to add comment to pull request #${prNumber}: ${error instanceof Error ? error.message : error}`); + } } async function addCommentToReferencedIssue(client: Octokit, prNumber: number, release: Release) { - const pullRequest = await getPullRequest(client, prNumber); - if (pullRequest.body) { - const issueNumber = pullRequestParser.getReferencedIssue( - github.context.repo.owner, - github.context.repo.repo, - pullRequest.body - ); - if (issueNumber) { - const message = [ - `The pull request #${prNumber} that closed this issue was merged and released as part of [_fastlane_ ${release.tag}](${release.htmlURL}) :rocket:`, - `Please let us know if the functionality works as expected as a reply here. If it does not, please open a new issue. Thanks!` - ]; - await addIssueComment(client, issueNumber, message.join('\n')); + try { + const pullRequest = await getPullRequest(client, prNumber); + if (pullRequest.body) { + const issueNumber = pullRequestParser.getReferencedIssue( + github.context.repo.owner, + github.context.repo.repo, + pullRequest.body + ); + if (issueNumber) { + const message = [ + `The pull request #${prNumber} that closed this issue was merged and released as part of [_fastlane_ ${release.tag}](${release.htmlURL}) :rocket:`, + `Please let us know if the functionality works as expected as a reply here. If it does not, please open a new issue. Thanks!` + ]; + await addIssueComment(client, issueNumber, message.join('\n')); + } } + } catch (error) { + console.log( + `Failed to add comment to referenced issue for PR #${prNumber}: ${error instanceof Error ? error.message : error}` + ); } } @@ -98,37 +108,49 @@ async function getPullRequest(client: Octokit, prNumber: number) { } async function canRemoveLabelFromIssue(client: Octokit, prNumber: number, label: string): Promise { - const response = await client.rest.issues.listLabelsOnIssue({ - owner: github.context.repo.owner, - repo: github.context.repo.repo, - issue_number: prNumber - }); + try { + const response = await client.rest.issues.listLabelsOnIssue({ + owner: github.context.repo.owner, + repo: github.context.repo.repo, + issue_number: prNumber + }); - const issueLabels = response.data; - for (const issueLabel of issueLabels) { - if (issueLabel.name === label) { - return true; + const issueLabels = response.data; + for (const issueLabel of issueLabels) { + if (issueLabel.name === label) { + return true; + } } + } catch (error) { + console.log(`Failed to list labels on issue #${prNumber}: ${error instanceof Error ? error.message : error}`); } return false; } async function addLabels(client: Octokit, prNumber: number, labels: string[]) { - await client.rest.issues.addLabels({ - owner: github.context.repo.owner, - repo: github.context.repo.repo, - issue_number: prNumber, - labels: labels - }); + try { + await client.rest.issues.addLabels({ + owner: github.context.repo.owner, + repo: github.context.repo.repo, + issue_number: prNumber, + labels: labels + }); + } catch (error) { + console.log(`Failed to add labels to PR #${prNumber}: ${error instanceof Error ? error.message : error}`); + } } async function removeLabel(client: Octokit, prNumber: number, label: string) { - await client.rest.issues.removeLabel({ - owner: github.context.repo.owner, - repo: github.context.repo.repo, - issue_number: prNumber, - name: label - }); + try { + await client.rest.issues.removeLabel({ + owner: github.context.repo.owner, + repo: github.context.repo.repo, + issue_number: prNumber, + name: label + }); + } catch (error) { + console.log(`Failed to remove label '${label}' from PR #${prNumber}: ${error instanceof Error ? error.message : error}`); + } } async function addIssueComment(client: Octokit, issueNumber: number, message: string) { From 27cefb42f23b1217a3cb9c4b5fe69b58ab94c534 Mon Sep 17 00:00:00 2001 From: iBotPeaches <611784+iBotPeaches@users.noreply.github.com> Date: Sat, 17 Jan 2026 13:40:03 +0000 Subject: [PATCH 02/10] chore: upgrade dist files for communicate-on-pull-request-released --- .../lib/index.js | 99 ++++++++++++------- 1 file changed, 62 insertions(+), 37 deletions(-) diff --git a/communicate-on-pull-request-released/lib/index.js b/communicate-on-pull-request-released/lib/index.js index fd52163..f4138c9 100644 --- a/communicate-on-pull-request-released/lib/index.js +++ b/communicate-on-pull-request-released/lib/index.js @@ -36810,26 +36810,36 @@ async function run() { } } async function addCommentToPullRequest(client, prNumber, comment) { - await client.rest.pulls.createReview({ - owner: github.context.repo.owner, - repo: github.context.repo.repo, - pull_number: prNumber, - body: comment, - event: 'COMMENT' - }); + try { + await client.rest.pulls.createReview({ + owner: github.context.repo.owner, + repo: github.context.repo.repo, + pull_number: prNumber, + body: comment, + event: 'COMMENT' + }); + } + catch (error) { + console.log(`Failed to add comment to pull request #${prNumber}: ${error instanceof Error ? error.message : error}`); + } } async function addCommentToReferencedIssue(client, prNumber, release) { - const pullRequest = await getPullRequest(client, prNumber); - if (pullRequest.body) { - const issueNumber = getReferencedIssue(github.context.repo.owner, github.context.repo.repo, pullRequest.body); - if (issueNumber) { - const message = [ - `The pull request #${prNumber} that closed this issue was merged and released as part of [_fastlane_ ${release.tag}](${release.htmlURL}) :rocket:`, - `Please let us know if the functionality works as expected as a reply here. If it does not, please open a new issue. Thanks!` - ]; - await addIssueComment(client, issueNumber, message.join('\n')); + try { + const pullRequest = await getPullRequest(client, prNumber); + if (pullRequest.body) { + const issueNumber = getReferencedIssue(github.context.repo.owner, github.context.repo.repo, pullRequest.body); + if (issueNumber) { + const message = [ + `The pull request #${prNumber} that closed this issue was merged and released as part of [_fastlane_ ${release.tag}](${release.htmlURL}) :rocket:`, + `Please let us know if the functionality works as expected as a reply here. If it does not, please open a new issue. Thanks!` + ]; + await addIssueComment(client, issueNumber, message.join('\n')); + } } } + catch (error) { + console.log(`Failed to add comment to referenced issue for PR #${prNumber}: ${error instanceof Error ? error.message : error}`); + } } async function getPullRequest(client, prNumber) { const response = await client.rest.pulls.get({ @@ -36840,34 +36850,49 @@ async function getPullRequest(client, prNumber) { return response.data; } async function canRemoveLabelFromIssue(client, prNumber, label) { - const response = await client.rest.issues.listLabelsOnIssue({ - owner: github.context.repo.owner, - repo: github.context.repo.repo, - issue_number: prNumber - }); - const issueLabels = response.data; - for (const issueLabel of issueLabels) { - if (issueLabel.name === label) { - return true; + try { + const response = await client.rest.issues.listLabelsOnIssue({ + owner: github.context.repo.owner, + repo: github.context.repo.repo, + issue_number: prNumber + }); + const issueLabels = response.data; + for (const issueLabel of issueLabels) { + if (issueLabel.name === label) { + return true; + } } } + catch (error) { + console.log(`Failed to list labels on issue #${prNumber}: ${error instanceof Error ? error.message : error}`); + } return false; } async function addLabels(client, prNumber, labels) { - await client.rest.issues.addLabels({ - owner: github.context.repo.owner, - repo: github.context.repo.repo, - issue_number: prNumber, - labels: labels - }); + try { + await client.rest.issues.addLabels({ + owner: github.context.repo.owner, + repo: github.context.repo.repo, + issue_number: prNumber, + labels: labels + }); + } + catch (error) { + console.log(`Failed to add labels to PR #${prNumber}: ${error instanceof Error ? error.message : error}`); + } } async function removeLabel(client, prNumber, label) { - await client.rest.issues.removeLabel({ - owner: github.context.repo.owner, - repo: github.context.repo.repo, - issue_number: prNumber, - name: label - }); + try { + await client.rest.issues.removeLabel({ + owner: github.context.repo.owner, + repo: github.context.repo.repo, + issue_number: prNumber, + name: label + }); + } + catch (error) { + console.log(`Failed to remove label '${label}' from PR #${prNumber}: ${error instanceof Error ? error.message : error}`); + } } async function addIssueComment(client, issueNumber, message) { await client.rest.issues.createComment({ From 97647d5909a9f451aa344f80f825c73835cf2480 Mon Sep 17 00:00:00 2001 From: Connor Tumbleson Date: Sat, 17 Jan 2026 08:47:34 -0500 Subject: [PATCH 03/10] fix: support multiple issues in 1 pr (#171) * fix: support multiple issues in 1 pr * chore: restore old test --- .../__tests__/pull-request-parser.test.ts | 10 ++++-- .../src/main.ts | 4 +-- .../src/pull-request-parser.ts | 35 +++++++++++-------- 3 files changed, 31 insertions(+), 18 deletions(-) diff --git a/communicate-on-pull-request-released/__tests__/pull-request-parser.test.ts b/communicate-on-pull-request-released/__tests__/pull-request-parser.test.ts index 610e3ba..d4989fa 100644 --- a/communicate-on-pull-request-released/__tests__/pull-request-parser.test.ts +++ b/communicate-on-pull-request-released/__tests__/pull-request-parser.test.ts @@ -67,6 +67,12 @@ describe('pull request parser test suite', () => { issueNumber: 15, owner: 'foo', repo: 'bar' + }, + { + prBody: 'Fixes #456 and closes #456', + issueNumber: 456, + owner: 'foo', + repo: 'bar' } ]; @@ -120,13 +126,13 @@ describe('pull request parser test suite', () => { for (const scenario of validScenarios) { it(`It detects referenced issue for (${scenario.prBody})`, async () => { - expect(getReferencedIssue(scenario.owner, scenario.repo, scenario.prBody)).toEqual(scenario.issueNumber); + expect(getReferencedIssue(scenario.owner, scenario.repo, scenario.prBody)).toEqual([scenario.issueNumber]); }); } for (const scenario of invalidScenarios) { it(`It does not detect referenced issue for (${scenario.prBody})`, async () => { - expect(getReferencedIssue(scenario.owner, scenario.repo, scenario.prBody)).toBeUndefined(); + expect(getReferencedIssue(scenario.owner, scenario.repo, scenario.prBody)).toEqual([]); }); } }); diff --git a/communicate-on-pull-request-released/src/main.ts b/communicate-on-pull-request-released/src/main.ts index 7a5de6f..daaa540 100644 --- a/communicate-on-pull-request-released/src/main.ts +++ b/communicate-on-pull-request-released/src/main.ts @@ -78,12 +78,12 @@ async function addCommentToReferencedIssue(client: Octokit, prNumber: number, re try { const pullRequest = await getPullRequest(client, prNumber); if (pullRequest.body) { - const issueNumber = pullRequestParser.getReferencedIssue( + const issueNumbers = pullRequestParser.getReferencedIssue( github.context.repo.owner, github.context.repo.repo, pullRequest.body ); - if (issueNumber) { + for (const issueNumber of issueNumbers) { const message = [ `The pull request #${prNumber} that closed this issue was merged and released as part of [_fastlane_ ${release.tag}](${release.htmlURL}) :rocket:`, `Please let us know if the functionality works as expected as a reply here. If it does not, please open a new issue. Thanks!` diff --git a/communicate-on-pull-request-released/src/pull-request-parser.ts b/communicate-on-pull-request-released/src/pull-request-parser.ts index 4a3b16c..0c0c2d7 100644 --- a/communicate-on-pull-request-released/src/pull-request-parser.ts +++ b/communicate-on-pull-request-released/src/pull-request-parser.ts @@ -14,35 +14,42 @@ let ISSUE_CLOSING_KEYWORDS = [ 'fix:' ]; -export function getReferencedIssue(owner: string, repo: string, prBody: string): number | undefined { +export function getReferencedIssue(owner: string, repo: string, prBody: string): number[] { if (!prBody || prBody.trim() === '') { - return undefined; + return []; } + + let issueNumbers: number[] = []; + // Searching for issue closing keywords and issue identifier in pull request's description, // i.e. `fixes #1234`, `close #444`, `resolved #1` - let regex = new RegExp(`(${ISSUE_CLOSING_KEYWORDS.join('|')}) #\\d{1,}`, 'i'); + let regex = new RegExp(`(${ISSUE_CLOSING_KEYWORDS.join('|')}) #\\d{1,}`, 'gi'); let matched = prBody.match(regex); if (matched && matched.length > 0) { - const issueMatch = matched[0].match(/#\d{1,}/i); - if (issueMatch && issueMatch.length > 0) { - const issueNumber = issueMatch[0].replace('#', ''); - return Number(issueNumber); - } + matched.forEach(match => { + const issueMatch = match.match(/#\d{1,}/i); + if (issueMatch && issueMatch.length > 0) { + const issueNumber = issueMatch[0].replace('#', ''); + issueNumbers.push(Number(issueNumber)); + } + }); } // Searching for issue closing keywords and issue URL in pull request's description, // i.e. `closes https://github.com/REPOSITORY_OWNER/REPOSITORY_NAME/issues/1234` regex = new RegExp( `(${ISSUE_CLOSING_KEYWORDS.join('|')}) https:\\/\\/github.com\\/${owner}\\/${repo}\\/issues\\/\\d{1,}`, - 'i' + 'gi' ); matched = prBody.match(regex); if (matched && matched.length > 0) { - const issue = matched[0].split('/').pop(); - if (issue) { - return Number(issue); - } + matched.forEach(match => { + const issue = match.split('/').pop(); + if (issue) { + issueNumbers.push(Number(issue)); + } + }); } - return undefined; + return [...new Set(issueNumbers)]; } From 2df380fe609e72c58a137895ffcd7ba5906b8821 Mon Sep 17 00:00:00 2001 From: iBotPeaches <611784+iBotPeaches@users.noreply.github.com> Date: Sat, 17 Jan 2026 13:48:07 +0000 Subject: [PATCH 04/10] chore: upgrade dist files for communicate-on-pull-request-released --- .../lib/index.js | 35 +++++++++++-------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/communicate-on-pull-request-released/lib/index.js b/communicate-on-pull-request-released/lib/index.js index f4138c9..3d2940c 100644 --- a/communicate-on-pull-request-released/lib/index.js +++ b/communicate-on-pull-request-released/lib/index.js @@ -36712,30 +36712,35 @@ let ISSUE_CLOSING_KEYWORDS = [ ]; function getReferencedIssue(owner, repo, prBody) { if (!prBody || prBody.trim() === '') { - return undefined; + return []; } + let issueNumbers = []; // Searching for issue closing keywords and issue identifier in pull request's description, // i.e. `fixes #1234`, `close #444`, `resolved #1` - let regex = new RegExp(`(${ISSUE_CLOSING_KEYWORDS.join('|')}) #\\d{1,}`, 'i'); + let regex = new RegExp(`(${ISSUE_CLOSING_KEYWORDS.join('|')}) #\\d{1,}`, 'gi'); let matched = prBody.match(regex); if (matched && matched.length > 0) { - const issueMatch = matched[0].match(/#\d{1,}/i); - if (issueMatch && issueMatch.length > 0) { - const issueNumber = issueMatch[0].replace('#', ''); - return Number(issueNumber); - } + matched.forEach(match => { + const issueMatch = match.match(/#\d{1,}/i); + if (issueMatch && issueMatch.length > 0) { + const issueNumber = issueMatch[0].replace('#', ''); + issueNumbers.push(Number(issueNumber)); + } + }); } // Searching for issue closing keywords and issue URL in pull request's description, // i.e. `closes https://github.com/REPOSITORY_OWNER/REPOSITORY_NAME/issues/1234` - regex = new RegExp(`(${ISSUE_CLOSING_KEYWORDS.join('|')}) https:\\/\\/github.com\\/${owner}\\/${repo}\\/issues\\/\\d{1,}`, 'i'); + regex = new RegExp(`(${ISSUE_CLOSING_KEYWORDS.join('|')}) https:\\/\\/github.com\\/${owner}\\/${repo}\\/issues\\/\\d{1,}`, 'gi'); matched = prBody.match(regex); if (matched && matched.length > 0) { - const issue = matched[0].split('/').pop(); - if (issue) { - return Number(issue); - } + matched.forEach(match => { + const issue = match.split('/').pop(); + if (issue) { + issueNumbers.push(Number(issue)); + } + }); } - return undefined; + return [...new Set(issueNumbers)]; } ;// CONCATENATED MODULE: ./src/release-parser.ts @@ -36827,8 +36832,8 @@ async function addCommentToReferencedIssue(client, prNumber, release) { try { const pullRequest = await getPullRequest(client, prNumber); if (pullRequest.body) { - const issueNumber = getReferencedIssue(github.context.repo.owner, github.context.repo.repo, pullRequest.body); - if (issueNumber) { + const issueNumbers = getReferencedIssue(github.context.repo.owner, github.context.repo.repo, pullRequest.body); + for (const issueNumber of issueNumbers) { const message = [ `The pull request #${prNumber} that closed this issue was merged and released as part of [_fastlane_ ${release.tag}](${release.htmlURL}) :rocket:`, `Please let us know if the functionality works as expected as a reply here. If it does not, please open a new issue. Thanks!` From 21d72d5b7f48d308d0f587c2127abfa7a823ef1a Mon Sep 17 00:00:00 2001 From: Connor Tumbleson Date: Sat, 17 Jan 2026 09:11:25 -0500 Subject: [PATCH 05/10] fix: support blank pr labels for released/merged jobs (#172) --- .../__tests__/main.test.ts | 26 ++++++++++++++++ communicate-on-pull-request-merged/action.yml | 6 ++-- .../src/main.ts | 13 +++++--- .../__tests__/main.test.ts | 31 +++++++++++++++++++ .../action.yml | 2 ++ .../jest.config.js | 1 + .../src/main.ts | 13 +++++--- 7 files changed, 82 insertions(+), 10 deletions(-) diff --git a/communicate-on-pull-request-merged/__tests__/main.test.ts b/communicate-on-pull-request-merged/__tests__/main.test.ts index ec6b63d..2ad35b2 100755 --- a/communicate-on-pull-request-merged/__tests__/main.test.ts +++ b/communicate-on-pull-request-merged/__tests__/main.test.ts @@ -48,6 +48,32 @@ describe('action test suite', () => { expect(api.isDone()).toBeTruthy(); }); + + it(`It does not crash when labels are empty for (${scenario.response})`, async () => { + process.env['INPUT_REPO-TOKEN'] = 'token'; + process.env['INPUT_PR-COMMENT'] = 'message'; + process.env['INPUT_PR-LABEL-TO-ADD'] = ''; + process.env['INPUT_PR-LABEL-TO-REMOVE'] = ''; + + process.env['GITHUB_REPOSITORY'] = 'foo/bar'; + process.env['GITHUB_EVENT_PATH'] = path.join(__dirname, scenario.response); + + const {run} = await import('../src/main.js'); + + const api = nock('https://api.github.com') + .post('/repos/foo/bar/pulls/10/reviews', '{"body":"message","event":"COMMENT"}') + .reply(200); + + // These should NOT be called + const labelsGet = nock('https://api.github.com').get('/repos/foo/bar/issues/10/labels').reply(200, []); + const labelsPost = nock('https://api.github.com').post('/repos/foo/bar/issues/10/labels').reply(200); + + await run(); + + expect(api.isDone()).toBeTruthy(); + expect(labelsGet.isDone()).toBeFalsy(); + expect(labelsPost.isDone()).toBeFalsy(); + }); } for (const scenario of invalidScenarios) { diff --git a/communicate-on-pull-request-merged/action.yml b/communicate-on-pull-request-merged/action.yml index 6e29135..73e488b 100755 --- a/communicate-on-pull-request-merged/action.yml +++ b/communicate-on-pull-request-merged/action.yml @@ -11,9 +11,11 @@ inputs: pr-label-to-add: description: 'The label to apply when a pull request is merged' default: 'status: included-in-next-release' + required: false pr-label-to-remove: - description: 'The label to remove when a pull request is merged' - default: 'status: needs-attention' + description: 'The label to remove when a pull request is merged' + default: 'status: needs-attention' + required: false runs: using: node24 main: lib/index.js diff --git a/communicate-on-pull-request-merged/src/main.ts b/communicate-on-pull-request-merged/src/main.ts index e692961..33dad31 100755 --- a/communicate-on-pull-request-merged/src/main.ts +++ b/communicate-on-pull-request-merged/src/main.ts @@ -27,12 +27,17 @@ export async function run() { } const labelToRemove = core.getInput('pr-label-to-remove'); - const canRemoveLabel = await canRemoveLabelFromIssue(client, prNumber, labelToRemove); - if (canRemoveLabel) { - await removeLabel(client, prNumber, labelToRemove); + if (labelToRemove) { + const canRemoveLabel = await canRemoveLabelFromIssue(client, prNumber, labelToRemove); + if (canRemoveLabel) { + await removeLabel(client, prNumber, labelToRemove); + } } - await addLabels(client, prNumber, [core.getInput('pr-label-to-add')]); + const labelToAdd = core.getInput('pr-label-to-add'); + if (labelToAdd) { + await addLabels(client, prNumber, [labelToAdd]); + } await addComment(client, prNumber, core.getInput('pr-comment', {required: true})); } catch (error) { if (error instanceof Error) { diff --git a/communicate-on-pull-request-released/__tests__/main.test.ts b/communicate-on-pull-request-released/__tests__/main.test.ts index 6be5889..e0172dd 100644 --- a/communicate-on-pull-request-released/__tests__/main.test.ts +++ b/communicate-on-pull-request-released/__tests__/main.test.ts @@ -48,6 +48,37 @@ describe('action test suite', () => { expect(api.isDone()).toBeTruthy(); }); + + it(`It does not crash when labels are empty for (${scenario.response})`, async () => { + process.env['INPUT_REPO-TOKEN'] = 'token'; + process.env['INPUT_PR-LABEL-TO-ADD'] = ''; + process.env['INPUT_PR-LABEL-TO-REMOVE'] = ''; + + process.env['GITHUB_REPOSITORY'] = 'foo/bar'; + process.env['GITHUB_EVENT_NAME'] = scenario.event_name; + process.env['GITHUB_EVENT_PATH'] = path.join(__dirname, scenario.response); + + const {run} = await import('../src/main.js'); + + const api = nock('https://api.github.com') + .persist() + .post( + '/repos/foo/bar/pulls/999/reviews', + '{"body":"Congratulations! :tada: This was released as part of [_fastlane_ 2.134.1](https://github.com/Codertocat/Hello-World/runs/128620228) :rocket:","event":"COMMENT"}' + ) + .reply(200) + .get('/repos/foo/bar/pulls/999') + .reply(200, JSON.parse('{"body":"closes #10"}')) + .post( + '/repos/foo/bar/issues/10/comments', + '{"body":"The pull request #999 that closed this issue was merged and released as part of [_fastlane_ 2.134.1](https://github.com/Codertocat/Hello-World/runs/128620228) :rocket:\\nPlease let us know if the functionality works as expected as a reply here. If it does not, please open a new issue. Thanks!"}' + ) + .reply(200); + + await run(); + + expect(api.isDone()).toBeTruthy(); + }); } }); diff --git a/communicate-on-pull-request-released/action.yml b/communicate-on-pull-request-released/action.yml index ca84022..32d9869 100644 --- a/communicate-on-pull-request-released/action.yml +++ b/communicate-on-pull-request-released/action.yml @@ -11,9 +11,11 @@ inputs: pr-label-to-add: description: 'The label to apply when a pull request is released' default: 'status: released' + required: false pr-label-to-remove: description: 'The label to remove when a pull request is released' default: 'status: included-in-next-release' + required: false runs: using: 'node24' main: 'lib/index.js' diff --git a/communicate-on-pull-request-released/jest.config.js b/communicate-on-pull-request-released/jest.config.js index a26cbd9..98202be 100644 --- a/communicate-on-pull-request-released/jest.config.js +++ b/communicate-on-pull-request-released/jest.config.js @@ -11,6 +11,7 @@ export default { preset: 'ts-jest', reporters: ['default'], resolver: 'ts-jest-resolver', + resetModules: true, setupFilesAfterEnv: ['./__tests__/setup.js'], testEnvironment: 'node', testMatch: ['**/*.test.ts'], diff --git a/communicate-on-pull-request-released/src/main.ts b/communicate-on-pull-request-released/src/main.ts index daaa540..93f4bae 100644 --- a/communicate-on-pull-request-released/src/main.ts +++ b/communicate-on-pull-request-released/src/main.ts @@ -44,11 +44,16 @@ export async function run() { `Congratulations! :tada: This was released as part of [_fastlane_ ${release.tag}](${release.htmlURL}) :rocket:` ); const labelToRemove = core.getInput('pr-label-to-remove'); - const canRemoveLabel = await canRemoveLabelFromIssue(client, prNumber, labelToRemove); - if (canRemoveLabel) { - await removeLabel(client, prNumber, labelToRemove); + if (labelToRemove) { + const canRemoveLabel = await canRemoveLabelFromIssue(client, prNumber, labelToRemove); + if (canRemoveLabel) { + await removeLabel(client, prNumber, labelToRemove); + } + } + const labelToAdd = core.getInput('pr-label-to-add'); + if (labelToAdd) { + await addLabels(client, prNumber, [labelToAdd]); } - await addLabels(client, prNumber, [core.getInput('pr-label-to-add')]); await addCommentToReferencedIssue(client, prNumber, release); } } catch (error) { From 33fdcf5e77d11df8f529d93ffae48e7781f39452 Mon Sep 17 00:00:00 2001 From: iBotPeaches <611784+iBotPeaches@users.noreply.github.com> Date: Sat, 17 Jan 2026 14:11:45 +0000 Subject: [PATCH 06/10] chore: upgrade dist files for communicate-on-pull-request-merged --- communicate-on-pull-request-merged/lib/index.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/communicate-on-pull-request-merged/lib/index.js b/communicate-on-pull-request-merged/lib/index.js index fb7ffb2..910bf9d 100644 --- a/communicate-on-pull-request-merged/lib/index.js +++ b/communicate-on-pull-request-merged/lib/index.js @@ -36722,11 +36722,16 @@ async function run() { return; } const labelToRemove = core.getInput('pr-label-to-remove'); - const canRemoveLabel = await canRemoveLabelFromIssue(client, prNumber, labelToRemove); - if (canRemoveLabel) { - await removeLabel(client, prNumber, labelToRemove); + if (labelToRemove) { + const canRemoveLabel = await canRemoveLabelFromIssue(client, prNumber, labelToRemove); + if (canRemoveLabel) { + await removeLabel(client, prNumber, labelToRemove); + } + } + const labelToAdd = core.getInput('pr-label-to-add'); + if (labelToAdd) { + await addLabels(client, prNumber, [labelToAdd]); } - await addLabels(client, prNumber, [core.getInput('pr-label-to-add')]); await addComment(client, prNumber, core.getInput('pr-comment', { required: true })); } catch (error) { From abb4b6df1c4806c39bc71cb25c2d6f778209aa5d Mon Sep 17 00:00:00 2001 From: Connor Tumbleson Date: Sat, 17 Jan 2026 09:20:37 -0500 Subject: [PATCH 07/10] docs: fix license link on readmes (#173) --- communicate-on-pull-request-merged/README.md | 2 +- communicate-on-pull-request-released/README.md | 2 +- fastlane-env-reminder/README.md | 2 +- lock/README.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/communicate-on-pull-request-merged/README.md b/communicate-on-pull-request-merged/README.md index 5a3a4d2..78c5f3c 100755 --- a/communicate-on-pull-request-merged/README.md +++ b/communicate-on-pull-request-merged/README.md @@ -16,4 +16,4 @@ steps: # License -The scripts and documentation in this project are released under the [MIT License](LICENSE) \ No newline at end of file +The scripts and documentation in this project are released under the [MIT License](../LICENSE) diff --git a/communicate-on-pull-request-released/README.md b/communicate-on-pull-request-released/README.md index 638c793..adf4813 100644 --- a/communicate-on-pull-request-released/README.md +++ b/communicate-on-pull-request-released/README.md @@ -15,4 +15,4 @@ steps: # License -The scripts and documentation in this project are released under the [MIT License](LICENSE) \ No newline at end of file +The scripts and documentation in this project are released under the [MIT License](../LICENSE) diff --git a/fastlane-env-reminder/README.md b/fastlane-env-reminder/README.md index 9463d00..e062088 100755 --- a/fastlane-env-reminder/README.md +++ b/fastlane-env-reminder/README.md @@ -15,4 +15,4 @@ steps: # License -The scripts and documentation in this project are released under the [MIT License](LICENSE) +The scripts and documentation in this project are released under the [MIT License](../LICENSE) diff --git a/lock/README.md b/lock/README.md index 2894899..433f6d7 100644 --- a/lock/README.md +++ b/lock/README.md @@ -23,4 +23,4 @@ jobs: # License -The scripts and documentation in this project are released under the [MIT License](LICENSE) \ No newline at end of file +The scripts and documentation in this project are released under the [MIT License](../LICENSE) From 3caa4283f519d5adad3326b6b9c9642846ee83b9 Mon Sep 17 00:00:00 2001 From: iBotPeaches <611784+iBotPeaches@users.noreply.github.com> Date: Sat, 17 Jan 2026 14:21:17 +0000 Subject: [PATCH 08/10] chore: upgrade dist files for communicate-on-pull-request-released --- communicate-on-pull-request-released/lib/index.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/communicate-on-pull-request-released/lib/index.js b/communicate-on-pull-request-released/lib/index.js index 3d2940c..325e9d1 100644 --- a/communicate-on-pull-request-released/lib/index.js +++ b/communicate-on-pull-request-released/lib/index.js @@ -36797,11 +36797,16 @@ async function run() { for (const prNumber of prNumbers) { await addCommentToPullRequest(client, prNumber, `Congratulations! :tada: This was released as part of [_fastlane_ ${release.tag}](${release.htmlURL}) :rocket:`); const labelToRemove = core.getInput('pr-label-to-remove'); - const canRemoveLabel = await canRemoveLabelFromIssue(client, prNumber, labelToRemove); - if (canRemoveLabel) { - await removeLabel(client, prNumber, labelToRemove); + if (labelToRemove) { + const canRemoveLabel = await canRemoveLabelFromIssue(client, prNumber, labelToRemove); + if (canRemoveLabel) { + await removeLabel(client, prNumber, labelToRemove); + } + } + const labelToAdd = core.getInput('pr-label-to-add'); + if (labelToAdd) { + await addLabels(client, prNumber, [labelToAdd]); } - await addLabels(client, prNumber, [core.getInput('pr-label-to-add')]); await addCommentToReferencedIssue(client, prNumber, release); } } From eb0b615e6acd5fdab66c0e7d8a136be84d889cd3 Mon Sep 17 00:00:00 2001 From: Connor Tumbleson Date: Wed, 21 Jan 2026 06:18:19 -0500 Subject: [PATCH 09/10] chore: remove duplicate run() call on released job (#177) --- communicate-on-pull-request-released/src/main.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/communicate-on-pull-request-released/src/main.ts b/communicate-on-pull-request-released/src/main.ts index 93f4bae..da0adfe 100644 --- a/communicate-on-pull-request-released/src/main.ts +++ b/communicate-on-pull-request-released/src/main.ts @@ -215,5 +215,3 @@ async function resolveReleaseByVersion(client: Octokit, version: string): Promis return undefined; } } - -run(); From 9d169551c320140defc7894ca86e328b995831d8 Mon Sep 17 00:00:00 2001 From: iBotPeaches <611784+iBotPeaches@users.noreply.github.com> Date: Wed, 21 Jan 2026 11:18:56 +0000 Subject: [PATCH 10/10] chore: upgrade dist files for communicate-on-pull-request-released --- communicate-on-pull-request-released/lib/index.js | 1 - 1 file changed, 1 deletion(-) diff --git a/communicate-on-pull-request-released/lib/index.js b/communicate-on-pull-request-released/lib/index.js index 325e9d1..9102ec1 100644 --- a/communicate-on-pull-request-released/lib/index.js +++ b/communicate-on-pull-request-released/lib/index.js @@ -36953,7 +36953,6 @@ async function resolveReleaseByVersion(client, version) { return undefined; } } -run(); ;// CONCATENATED MODULE: ./src/index.ts