Skip to content

Commit bd8d28a

Browse files
committed
/updpkgsums: pass all workflow dispatch inputs as strings
When using a bare number as input, GitHub reacts with 422 as `statusCode` and the `statusMessage` "Unprocessable Entity". Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent 6a31ce3 commit bd8d28a

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

GitForWindowsHelper/slash-commands.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ module.exports = async (context, req) => {
124124
'updpkgsums.yml',
125125
'main', {
126126
repo,
127-
'pr-number': issueNumber,
127+
'pr-number': '' + issueNumber,
128128
actor: commenter
129129
}
130130
);

__tests__/index.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ The workflow run [was started](dispatched-workflow-updpkgsums.yml).`,
354354
expect(mockGetInstallationAccessToken).toHaveBeenCalledTimes(1)
355355
expect(mockGitHubApiRequestAsApp).not.toHaveBeenCalled()
356356
expect(dispatchedWorkflows).toHaveLength(1)
357-
expect(dispatchedWorkflows.map(e => e.payload.inputs['pr-number'])).toEqual([104])
357+
expect(dispatchedWorkflows.map(e => e.payload.inputs['pr-number'])).toEqual(['104'])
358358
expect(mockGitHubApiRequest).toHaveBeenCalled()
359359
const comment = mockGitHubApiRequest.mock.calls[mockGitHubApiRequest.mock.calls.length - 1]
360360
expect(comment[3]).toEqual('/repos/git-for-windows/MINGW-packages/issues/comments/0')

0 commit comments

Comments
 (0)