Set permissions for GitHub Actions (#10607)

This commit is contained in:
neilnaveen 2022-07-02 04:40:42 -05:00 committed by GitHub
parent b9736f2348
commit cf8d5357fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 23 additions and 0 deletions

View File

@ -2,6 +2,9 @@ name: Build document
on: [push, pull_request] on: [push, pull_request]
permissions:
contents: read
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest

View File

@ -2,6 +2,9 @@ name: Coverage
on: [push] on: [push]
permissions:
contents: read
jobs: jobs:
coverage: coverage:
runs-on: ubuntu-latest runs-on: ubuntu-latest

View File

@ -5,8 +5,13 @@ on:
tags: tags:
- "v*.*.*" - "v*.*.*"
permissions:
contents: read
jobs: jobs:
create-release: create-release:
permissions:
contents: write # for softprops/action-gh-release to create GitHub release
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout

View File

@ -5,6 +5,9 @@ on:
- cron: "0 0 * * SUN" - cron: "0 0 * * SUN"
workflow_dispatch: workflow_dispatch:
permissions:
contents: read
jobs: jobs:
test: test:
if: github.repository_owner == 'sphinx-doc' if: github.repository_owner == 'sphinx-doc'

View File

@ -2,6 +2,9 @@ name: Lint source code
on: [push, pull_request] on: [push, pull_request]
permissions:
contents: read
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest

View File

@ -5,6 +5,9 @@ on:
- cron: "0 0 * * SUN" - cron: "0 0 * * SUN"
workflow_dispatch: workflow_dispatch:
permissions:
contents: read
jobs: jobs:
push: push:
if: github.repository_owner == 'sphinx-doc' if: github.repository_owner == 'sphinx-doc'
@ -30,6 +33,9 @@ jobs:
TX_TOKEN: ${{ secrets.TX_TOKEN }} TX_TOKEN: ${{ secrets.TX_TOKEN }}
pull: pull:
permissions:
contents: write # for peter-evans/create-pull-request to create branch
pull-requests: write # for peter-evans/create-pull-request to create a PR
if: github.repository_owner == 'sphinx-doc' if: github.repository_owner == 'sphinx-doc'
runs-on: ubuntu-latest runs-on: ubuntu-latest