diff --git a/.github/workflows/create-comment-kernel-testing.yml b/.github/workflows/create-comment-kernel-testing.yml index e7ca7a68bb..adf52b70a2 100644 --- a/.github/workflows/create-comment-kernel-testing.yml +++ b/.github/workflows/create-comment-kernel-testing.yml @@ -23,9 +23,13 @@ jobs: repo: context.repo.repo, run_id: ${{github.event.workflow_run.id }}, }); - var matchArtifact = artifacts.data.artifacts.filter((artifact) => { + var matchArtifacts = artifacts.data.artifacts.filter((artifact) => { return artifact.name == "pr-kernel-testing" - })[0]; + }); + if (matchArtifacts == null) { + exit 0; + } + var matchArtifact = matchArtifacts[0]; var download = await github.rest.actions.downloadArtifact({ owner: context.repo.owner, repo: context.repo.repo, @@ -36,7 +40,10 @@ jobs: fs.writeFileSync('${{github.workspace}}/pr.zip', Buffer.from(download.data)); - name: 'Unpack artifact' - run: unzip pr.zip + run: + if [ -f pr.zip ]; then + unzip pr.zip + fi - name: 'Comment on PR' uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 @@ -45,6 +52,9 @@ jobs: # Taken from https://github.com/actions/github-script/blob/main/.github/workflows/pull-request-test.yml script: | var fs = require('fs'); + if (!fs.existsSync('./NR')) { + exit 0; + } var issue_number = Number(fs.readFileSync('./NR')); var comment_body = fs.readFileSync('./COMMENT');