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

Skip to content

Backport PR #24579: Add explicit permissions to GitHub Actions #24587

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -209,4 +209,6 @@ workflows:
version: 2
build:
jobs:
# NOTE: If you rename this job, then you must update the `if` condition
# and `circleci-jobs` option in `.github/workflows/circleci.yml`.
- docs-python38
4 changes: 4 additions & 0 deletions .github/workflows/cibuildsdist.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: Build CI sdist and wheel

on:
Expand All @@ -17,6 +18,9 @@ on:
- reopened
- labeled

permissions:
contents: read

jobs:
build_sdist:
if: |
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/cibuildwheel.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: Build CI wheels

on:
Expand All @@ -17,6 +18,9 @@ on:
- reopened
- labeled

permissions:
contents: read

jobs:
build_wheels:
if: |
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/circleci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
---
on: [status]
permissions:
statuses: write
jobs:
circleci_artifacts_redirector_job:
runs-on: ubuntu-latest
if: "${{ github.event.context == 'ci/circleci: docs-python38' }}"
name: Run CircleCI artifacts redirector
steps:
- name: GitHub Action step
Expand All @@ -11,3 +15,7 @@ jobs:
artifact-path: 0/doc/build/html/index.html
circleci-jobs: docs-python38
job-title: View the built docs
- name: Check the URL
if: github.event.status != 'pending'
run: |
curl --fail ${{ steps.step1.outputs.url }} | grep $GITHUB_SHA
4 changes: 4 additions & 0 deletions .github/workflows/clean_pr.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
---
name: PR cleanliness
on: [pull_request]

permissions:
contents: read

jobs:
pr_clean:
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/nightlies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
# Run on demand with workflow dispatch
workflow_dispatch:

permissions:
actions: read

jobs:
upload_nightly_wheels:
name: Upload nightly wheels to Anaconda Cloud
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/pr_welcome.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
---
name: PR Greetings

on: [pull_request_target]

permissions:
pull-requests: write

jobs:
greeting:
runs-on: ubuntu-latest
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/reviewdog.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
---
name: Linting
on: [pull_request]

permissions:
contents: read
checks: write
pull-requests: write

jobs:
flake8:
name: flake8
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: Tests
concurrency:
group: ${{ github.workflow }}-${{ github.event.number }}-${{ github.event.ref }}
Expand Down Expand Up @@ -25,6 +26,8 @@ env:
jobs:
test:
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]')"
permissions:
contents: read
name: "Python ${{ matrix.python-version }} on ${{ matrix.os }} ${{ matrix.name-suffix }}"
runs-on: ${{ matrix.os }}

Expand Down Expand Up @@ -281,9 +284,11 @@ jobs:

# Separate dependent job to only upload one issue from the matrix of jobs
create-issue:
runs-on: ubuntu-latest
needs: [test]
if: ${{ failure() && github.event_name == 'schedule' }}
needs: [test]
permissions:
issues: write
runs-on: ubuntu-latest
name: "Create issue on failure"

steps:
Expand Down