Skip to content

ci: Fix workflow permissions warning (#38) #88

ci: Fix workflow permissions warning (#38)

ci: Fix workflow permissions warning (#38) #88

Workflow file for this run

name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
files-changed:

Check failure on line 16 in .github/workflows/ci.yml

View workflow run for this annotation

GitHub Actions / CI

Invalid workflow file

The workflow is not valid. .github/workflows/ci.yml (Line: 16, Col: 3): Error calling workflow 'sonjek/go-templ-gorm-htmx-picocss-example/.github/workflows/files-changed.yml@e95b2bc62d5856cb82e654729580634f61d4186e'. The nested job 'detect' is requesting 'pull-requests: write', but is only allowed 'pull-requests: none'.
uses: ./.github/workflows/files-changed.yml
lint:
if: needs.files-changed.outputs.lint == 'true' || needs.files-changed.outputs.actions == 'true'
needs: files-changed
runs-on: macos-latest
permissions:
contents: read
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod
check-latest: true
- name: Run generate templ files
run: make generate-web
- name: Setup golangci-lint
uses: golangci/golangci-lint-action@v9
with:
version: latest
skip-cache: true
args: --timeout=10m --verbose
test:
if: needs.files-changed.outputs.app == 'true' || needs.files-changed.outputs.actions == 'true'
needs: files-changed
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
check-latest: true
- name: Run generate templ files
run: make generate-web
- name: Run tests
run: make test
build:
if: needs.files-changed.outputs.app == 'true' || needs.files-changed.outputs.actions == 'true'
needs: files-changed
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
check-latest: true
- name: Build
run: make build