feat: harden permissions for all github workflows

Signed-off-by: Joyce Brum <joycebrum@google.com>

Reviewed By: tstellar

Differential Revision: https://reviews.llvm.org/D144119
This commit is contained in:
Joyce Brum 2023-03-03 21:34:25 -08:00 committed by Tom Stellard
parent c0b4ca107a
commit 829b8912cd
14 changed files with 51 additions and 0 deletions

View File

@ -1,5 +1,8 @@
name: Clang Tests
permissions:
contents: read
on:
workflow_dispatch:
push:

View File

@ -3,8 +3,14 @@ on:
issues:
types: ['closed']
permissions:
contents: read
jobs:
automate-issues-labels:
permissions:
issues: write # for andymckay/labeler to label issues
pull-requests: write # for andymckay/labeler to label PRs
runs-on: ubuntu-latest
if: github.repository == 'llvm/llvm-project'
steps:

View File

@ -14,6 +14,9 @@
name: Issue Release Workflow
permissions:
contents: read
on:
issue_comment:
types:

View File

@ -5,6 +5,9 @@ on:
types:
- labeled
permissions:
contents: read
jobs:
auto-subscribe:
runs-on: ubuntu-latest

View File

@ -1,5 +1,8 @@
name: libclang ABI Tests
permissions:
contents: read
on:
workflow_dispatch:
push:

View File

@ -1,5 +1,8 @@
name: libclc Tests
permissions:
contents: read
on:
workflow_dispatch:
push:

View File

@ -1,5 +1,8 @@
name: LLD Tests
permissions:
contents: read
on:
workflow_dispatch:
push:

View File

@ -1,5 +1,8 @@
name: lldb Tests
permissions:
contents: read
on:
workflow_dispatch:
push:

View File

@ -1,5 +1,9 @@
name: LLVM Bugs notifier
permissions:
contents: read
issues: read
on:
issues:
types:

View File

@ -1,5 +1,8 @@
name: LLVM Project Tests
permissions:
contents: read
on:
workflow_dispatch:
inputs:

View File

@ -1,5 +1,8 @@
name: LLVM Tests
permissions:
contents: read
on:
workflow_dispatch:
push:

View File

@ -3,8 +3,14 @@ on:
issues:
types: ['opened']
permissions:
contents: read
jobs:
automate-issues-labels:
permissions:
issues: write # for andymckay/labeler to label issues
pull-requests: write # for andymckay/labeler to label PRs
runs-on: ubuntu-latest
if: github.repository == 'llvm/llvm-project'
steps:

View File

@ -1,5 +1,8 @@
name: Release Task
permissions:
contents: read
on:
push:
tags:
@ -8,6 +11,8 @@ on:
jobs:
release-tasks:
permissions:
contents: write # To upload assets to release.
runs-on: ubuntu-latest
if: github.repository == 'llvm/llvm-project'
steps:

View File

@ -8,6 +8,9 @@ on:
branches:
- 'release/**'
permissions:
contents: read
jobs:
version_check:
if: github.repository_owner == 'llvm'