Ghost/.github/workflows/label-actions.yml
Daniel Lockyer 6de598dec9
Loosened restrictions on GHA label-actions workflow
refs https://github.com/TryGhost/Toolbox/issues/381

- when using `pull_request`, the workflow doesn't have permissions to
  write to the PR in question
- there is another trigger - `pull_request_target` - but this comes with
  a heap of security warnings
- our use of it should be OK because we're only checking out our own
  Action and not code from the PR
- this commit also adds permissions to specify we only want write access
  to issues and PRs
2022-09-29 11:39:35 +07:00

22 lines
379 B
YAML

name: 'Label Issues'
on:
workflow_dispatch:
issues:
types: [opened, closed, labeled]
pull_request_target:
types: [closed, labeled]
schedule:
- cron: '0 * * * *'
permissions:
issues: write
pull-requests: write
jobs:
action:
runs-on: ubuntu-latest
if: github.repository_owner == 'TryGhost'
steps:
- uses: tryghost/label-actions@main