Skip to content

Commit 76538c7

Browse files
authored
Merge pull request #2147 from sashashura/patch-1
GitHub Workflows security hardening
2 parents aabe9bc + 7c672f9 commit 76538c7

File tree

4 files changed

+20
-0
lines changed

4 files changed

+20
-0
lines changed

.github/workflows/bot-label-lgtm.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ on:
1010
# From: issue_comment, pull_request_review
1111
types: [created, edited, submitted]
1212

13+
permissions:
14+
pull-requests: write # to add labels to pull-requests
15+
1316
jobs:
1417
lgtm-comment:
1518
# Check the comment. contains() is case-insensitive.

.github/workflows/bot-nightly.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,12 @@ on:
44
repository_dispatch:
55
types: [nightly]
66

7+
permissions: {}
78
jobs:
89
snapshot-source:
10+
permissions:
11+
contents: write # for git push
12+
913
name: Update Keras guides
1014
if : ${{ github.actor == 'tfdocsbot' }}
1115
runs-on: ubuntu-latest

.github/workflows/bot-pr-fix.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,15 @@ on:
66
repository_dispatch:
77
types: [opened, synchronize]
88

9+
permissions: {}
10+
911
jobs:
1012
nbfmt:
1113
# Check for opt-out label.
14+
permissions:
15+
contents: write
16+
pull-requests: write
17+
1218
if: >-
1319
${{ github.actor == 'tfdocsbot' &&
1420
!contains(github.event.client_payload.pull_request.labels.*.name, 'nbfmt-disable') }}

.github/workflows/bot-pr-new.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,15 @@ on:
66
repository_dispatch:
77
types: [opened, reopened]
88

9+
permissions:
10+
contents: read # to fetch code (actions/checkout)
11+
912
jobs:
1013
comment-welcome:
14+
permissions:
15+
contents: read # to fetch code (actions/checkout)
16+
pull-requests: write # to comment on pull-request
17+
1118
if: ${{ github.actor == 'tfdocsbot' }}
1219
runs-on: ubuntu-latest
1320
steps:

0 commit comments

Comments
 (0)