Previously the permissions were only applied to branches from this repository, not forks. Use `pull_request_target` so the `GITHUB_TOKEN` will have the correct permissions when this workflow is run from a PR created from a clone. Remove the `issues` permission, it didn't seem necessary.
36 lines
790 B
YAML
36 lines
790 B
YAML
name: reviewdog-suggester
|
|
on: pull_request_target
|
|
|
|
permissions:
|
|
contents: read
|
|
pull-requests: write
|
|
|
|
jobs:
|
|
ktlint:
|
|
timeout-minutes: 5
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/setup-java@v3
|
|
with:
|
|
distribution: 'temurin'
|
|
java-version: '17'
|
|
cache: 'gradle'
|
|
|
|
- run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties
|
|
|
|
- uses: gradle/wrapper-validation-action@v1
|
|
|
|
- uses: gradle/gradle-build-action@v2
|
|
with:
|
|
cache-read-only: ${{ github.ref != 'refs/heads/main' }}
|
|
|
|
- run: chmod +x ./gradlew
|
|
|
|
- run: ./gradlew ktlintFormat
|
|
|
|
- uses: reviewdog/action-suggester@v1
|
|
with:
|
|
tool_name: ktlintFormat
|