Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f902407

Browse files
authored
Merge pull request #24587 from tacaswell/auto-backport-of-pr-24579-on-v3.6.x
Backport PR #24579: Add explicit permissions to GitHub Actions
2 parents 336c6e1 + 733d967 commit f902407

File tree

9 files changed

+42
-2
lines changed

9 files changed

+42
-2
lines changed

.circleci/config.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,4 +209,6 @@ workflows:
209209
version: 2
210210
build:
211211
jobs:
212+
# NOTE: If you rename this job, then you must update the `if` condition
213+
# and `circleci-jobs` option in `.github/workflows/circleci.yml`.
212214
- docs-python38

.github/workflows/cibuildsdist.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: Build CI sdist and wheel
23

34
on:
@@ -17,6 +18,9 @@ on:
1718
- reopened
1819
- labeled
1920

21+
permissions:
22+
contents: read
23+
2024
jobs:
2125
build_sdist:
2226
if: |

.github/workflows/cibuildwheel.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: Build CI wheels
23

34
on:
@@ -17,6 +18,9 @@ on:
1718
- reopened
1819
- labeled
1920

21+
permissions:
22+
contents: read
23+
2024
jobs:
2125
build_wheels:
2226
if: |

.github/workflows/circleci.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1+
---
12
on: [status]
3+
permissions:
4+
statuses: write
25
jobs:
36
circleci_artifacts_redirector_job:
47
runs-on: ubuntu-latest
8+
if: "${{ github.event.context == 'ci/circleci: docs-python38' }}"
59
name: Run CircleCI artifacts redirector
610
steps:
711
- name: GitHub Action step
@@ -11,3 +15,7 @@ jobs:
1115
artifact-path: 0/doc/build/html/index.html
1216
circleci-jobs: docs-python38
1317
job-title: View the built docs
18+
- name: Check the URL
19+
if: github.event.status != 'pending'
20+
run: |
21+
curl --fail ${{ steps.step1.outputs.url }} | grep $GITHUB_SHA

.github/workflows/clean_pr.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1+
---
12
name: PR cleanliness
23
on: [pull_request]
34

5+
permissions:
6+
contents: read
7+
48
jobs:
59
pr_clean:
610
runs-on: ubuntu-latest

.github/workflows/nightlies.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ on:
77
# Run on demand with workflow dispatch
88
workflow_dispatch:
99

10+
permissions:
11+
actions: read
12+
1013
jobs:
1114
upload_nightly_wheels:
1215
name: Upload nightly wheels to Anaconda Cloud

.github/workflows/pr_welcome.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1+
---
12
name: PR Greetings
23

34
on: [pull_request_target]
45

6+
permissions:
7+
pull-requests: write
8+
59
jobs:
610
greeting:
711
runs-on: ubuntu-latest

.github/workflows/reviewdog.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1+
---
12
name: Linting
23
on: [pull_request]
34

5+
permissions:
6+
contents: read
7+
checks: write
8+
pull-requests: write
9+
410
jobs:
511
flake8:
612
name: flake8

.github/workflows/tests.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: Tests
23
concurrency:
34
group: ${{ github.workflow }}-${{ github.event.number }}-${{ github.event.ref }}
@@ -25,6 +26,8 @@ env:
2526
jobs:
2627
test:
2728
if: "github.event_name == 'workflow_dispatch' || github.repository == 'matplotlib/matplotlib' && !contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[skip github]')"
29+
permissions:
30+
contents: read
2831
name: "Python ${{ matrix.python-version }} on ${{ matrix.os }} ${{ matrix.name-suffix }}"
2932
runs-on: ${{ matrix.os }}
3033

@@ -281,9 +284,11 @@ jobs:
281284

282285
# Separate dependent job to only upload one issue from the matrix of jobs
283286
create-issue:
284-
runs-on: ubuntu-latest
285-
needs: [test]
286287
if: ${{ failure() && github.event_name == 'schedule' }}
288+
needs: [test]
289+
permissions:
290+
issues: write
291+
runs-on: ubuntu-latest
287292
name: "Create issue on failure"
288293

289294
steps:

0 commit comments

Comments
 (0)