Skip to content

Commit 01f7d32

Browse files
authored
Fix workflow notifications (#1703)
1 parent 3aa5488 commit 01f7d32

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

.github/workflows/codeql.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ jobs:
5656
uses: github/codeql-action/analyze@dd746615b3b9d728a6a37ca2045b68ca76d4841a # v3.28.8
5757

5858
workflow-notification:
59+
permissions:
60+
contents: read
61+
issues: write
5962
needs:
6063
- analyze
6164
if: always()

.github/workflows/owasp-dependency-check-daily.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ jobs:
4040
path: "**/build/reports"
4141

4242
workflow-notification:
43+
permissions:
44+
contents: read
45+
issues: write
4346
needs:
4447
- analyze
4548
if: always()

.github/workflows/reusable-workflow-notification.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,14 @@ on:
99
type: boolean
1010
required: true
1111

12+
permissions:
13+
contents: read
14+
1215
jobs:
1316
workflow-notification:
17+
permissions:
18+
contents: read
19+
issues: write
1420
runs-on: ubuntu-latest
1521
steps:
1622
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -19,7 +25,8 @@ jobs:
1925
env:
2026
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2127
run: |
22-
number=$(gh issue list --search "Workflow failed: $GITHUB_WORKFLOW" --limit 1 --json number -q .[].number)
28+
# TODO (trask) search doesn't support exact phrases, so it's possible that this could grab the wrong issue
29+
number=$(gh issue list --search "in:title Workflow failed: $GITHUB_WORKFLOW" --limit 1 --json number -q .[].number)
2330
2431
echo $number
2532
echo ${{ inputs.success }}

0 commit comments

Comments
 (0)