File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ permissions: {}
11
11
jobs :
12
12
test-sigstore :
13
13
runs-on : ubuntu-latest
14
+ if : github.repository_owner == 'secure-systems-lab' # only run upstream
14
15
15
16
permissions :
16
17
id-token : ' write' # ambient credential is used to sign
35
36
export CERT_ID=${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/.github/workflows/test-sigstore.yml@${GITHUB_REF}
36
37
export CERT_ISSUER=https://token.actions.githubusercontent.com
37
38
tox -e sigstore
39
+
40
+ - name : File an issue on failure
41
+ if : ${{ failure() }}
42
+ uses : actions/github-script@98814c53be79b1d30f795b907e553d8679345975
43
+ with :
44
+ script : |
45
+ const repo = context.repo.owner + "/" + context.repo.repo
46
+ const issues = await github.rest.search.issuesAndPullRequests({
47
+ q: "Sigstore+tests+failed+in:title+state:open+type:issue+repo:" + repo,
48
+ })
49
+ if (issues.data.total_count > 0) {
50
+ console.log("Issue open already, not creating.")
51
+ } else {
52
+ await github.rest.issues.create({
53
+ owner: context.repo.owner,
54
+ repo: context.repo.repo,
55
+ title: "Sigstore tests failed",
56
+ body: "Hey, it seems Sigstore tests have failed, please see - [workflow run](" +
57
+ "https://github.com/" + repo + "/actions/runs/" + context.runId + ")"
58
+ })
59
+ console.log("New issue created.")
60
+ }
You can’t perform that action at this time.
0 commit comments