Skip to content

Commit aaf7a32

Browse files
committed
/git-artifacts and /release need to be more careful when looking for runs
The `/git-artifacts` and `/release` slash commands need to look for `tag-git` and `git-artifacts` Check Runs, respectively. However, those Check Runs could potentially be created via regular PR workflow runs that are triggered by PRs opened by untrusted users. Let's make sure that these slash commands only ever look for Check Runs that were triggered by the GitForWindowsHelper GitHub App. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent d11f565 commit aaf7a32

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

GitForWindowsHelper/slash-commands.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,7 @@ module.exports = async (context, req) => {
289289
'tag-git'
290290
)
291291
const latest = runs
292+
.filter(run => run.app?.slug === 'gitforwindowshelper')
292293
.sort((a, b) => a.id - b.id)
293294
.pop()
294295
if (latest && latest.status === 'completed' && latest.conclusion === 'success') {
@@ -411,7 +412,7 @@ module.exports = async (context, req) => {
411412
workflowName
412413
)
413414
const latest = runs
414-
.filter(run => run.output.summary.indexOf(` from commit ${commitSHA} ` > 0))
415+
.filter(run => run.app?.slug === 'gitforwindowshelper' && run.output.summary.indexOf(` from commit ${commitSHA} ` > 0))
415416
.sort((a, b) => a.id - b.id)
416417
.pop()
417418
if (latest) {

0 commit comments

Comments
 (0)