ci: Make secrets available in CI workflow (#415)

Previous code used `pull_request:` which meant
`secrets.GRADLE_ENCRYPTION_KEY` was not available, so the configuration
cache was not restored.

Use `pull_request_target` to give the workflow access to `secrets`, and
explicitly downscope the permissions of `GITHUB_TOKEN` to read only.
This commit is contained in:
Nik Clayton 2024-02-04 20:45:00 +01:00 committed by GitHub
parent 54d7888316
commit 37a016576b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 1 deletions

View File

@ -1,12 +1,17 @@
name: CI
# Run on pull_request_target to access secrets.GRADLE_ENCRYPTION_KEY,
# and ensure permissions are marked read-only
on:
push:
tags:
- '*'
pull_request:
pull_request_target:
workflow_dispatch:
permissions: read-all
jobs:
build:
strategy: