Building the correct thing #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Validate Pull Request and auto-fix some issues | |
on: | |
push: | |
branches: | |
- "main" | |
pull_request: | |
types: [opened, synchronize, edited] | |
jobs: | |
Validate: | |
runs-on: ubuntu-latest | |
permissions: | |
# Give the default GITHUB_TOKEN write permission to commit and push the | |
# added or changed files to the repository. | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.11" | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: ">=1.20.0" | |
- uses: actions/setup-node@v4 | |
name: 'Setup Node' | |
with: | |
node-version: 20 | |
registry-url: https://registry.npmjs.org/ | |
- uses: pnpm/action-setup@v4 | |
name: 'Install pnpm' | |
with: | |
version: 9 | |
run_install: false | |
- name: Build frontend | |
run: | | |
pnpm -C frontend build | |
- name: Install tools | |
run: | | |
pip install pre-commit | |
go install github.com/lietu/go-pre-commit@latest | |
go install github.com/kisielk/errcheck@latest | |
go install honnef.co/go/tools/cmd/staticcheck@latest | |
# Run pre-commit --all-files | |
- uses: pre-commit/action@v3.0.1 | |
# Commit all changed files back to the repository | |
- uses: stefanzweifel/git-auto-commit-action@3ea6ae190baf489ba007f7c92608f33ce20ef04a # v4.16.0 | |
# Even if pre-commit gave an error, which it does always when it makes changes which we're trying to commit here | |
if: always() |