Skip to content

Commit 99590c6

Browse files
Specify default permissions, other security for "Update Label Directory" & "Flag Issues Unlabeled..." workflows (#8595)
* add default permissions, replace hard-coded url with secret * Clarify comments about Google Apps Script URL Updated comments for clarity regarding Google Apps Script URL. * Add permissions to flag issues unlabeled after deletion Add permissions for reading contents in workflow
1 parent e22f0aa commit 99590c6

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

.github/workflows/flag-issues-unlabeled-after-deletion.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ on:
1414
HACKFORLA_BOT_PA_TOKEN:
1515
required: true
1616

17+
permissions:
18+
contents: read
19+
1720
jobs:
1821
Flag-Issues-Unlabeled-After-Deletion:
1922
runs-on: ubuntu-latest

.github/workflows/update-label-directory.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ on:
77
label:
88
types: [edited, created, deleted]
99

10+
permissions:
11+
contents: read
12+
1013
jobs:
1114
# Check if the deleted label was in use. If so, flag the deletion and affected issues
1215
Flag-Issues-Unlabeled-After-Deletion:
@@ -35,14 +38,14 @@ jobs:
3538
const labelPacket = script({g: github, c: context})
3639
return labelPacket
3740
38-
# NOTE: the the URL below matches the **current deployment URL** of the Apps Script
39-
# associated with the 'Source of Truth'Label spreadsheet and maintained by
40-
# `hackforla-bot@hackforla.org`. (If something is broken, check this link first)
41+
# NOTE: the secret below references the **current deployment URL** of the Google
42+
# Apps Script associated with the 'Source of Truth'Label spreadsheet and maintained
43+
# by `hackforla-bot@hackforla.org`. (If something is broken, check this link first)
4144
- name: Send POST request to Google Apps Script
4245
env:
4346
label_edits: ${{ steps.update-label-directory.outputs.result }}
4447
run: |
45-
curl -X POST "https://script.google.com/macros/s/AKfycbw_kmDVqQW5J8wXWl1BXvJzALU6k0XYpAc5XJ7inQSyq8_opUuNg4ToBzh3Gf4M5jhw/exec" \
48+
curl -X POST "${{ secrets.GOOGLE_APPS_UPDATE_LABEL_DIRECTORY_URL }}" \
4649
-H "Content-Type: application/json" \
4750
-d "$label_edits"
4851

0 commit comments

Comments
 (0)