Harden workflows by limiting default permissions

This commit is contained in:
Tim Donohue
2022-10-31 10:33:38 -05:00
parent 41e694507e
commit d0bcf5efcc
4 changed files with 9 additions and 1 deletions

View File

@@ -6,6 +6,9 @@ name: Build
# Run this Build for all pushes / PRs to current branch
on: [push, pull_request]
permissions:
contents: read # to fetch code (actions/checkout)
jobs:
tests:
runs-on: ubuntu-latest

View File

@@ -12,6 +12,9 @@ on:
- 'dspace-**'
pull_request:
permissions:
contents: read # to fetch code (actions/checkout)
jobs:
docker:
# Ensure this job never runs on forked repos. It's only executed for 'dspace/dspace-angular'

View File

@@ -5,6 +5,7 @@ on:
issues:
types: [opened]
permissions: {}
jobs:
automation:
runs-on: ubuntu-latest

View File

@@ -11,13 +11,14 @@ on:
pull_request_target:
types: [ synchronize ]
permissions: {}
jobs:
triage:
# Ensure this job never runs on forked repos. It's only executed for 'dspace/dspace-angular'
if: github.repository == 'dspace/dspace-angular'
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
# See: https://github.com/prince-chrismc/label-merge-conflicts-action