Run Linters #89
This file contains hidden or 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: Run Linters | |
| on: | |
| workflow_dispatch: {} | |
| pull_request: | |
| branches: [main] | |
| types: [opened, synchronize, reopened] | |
| schedule: | |
| - cron: "00 18 * * *" | |
| jobs: | |
| main: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Clone the repo | |
| uses: actions/checkout@v6 | |
| - name: Install Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: go.mod | |
| - name: Run lefthook pre-commit checks (fast) | |
| id: pre_commit | |
| run: go tool lefthook run pre-commit --all-files | |
| - name: Run lefthook pre-push checks (slower) | |
| id: pre_push | |
| run: go tool lefthook run pre-push --all-files | |
| # TODO: Implement GH issue creation when pre_push fails. | |
| # Desired steps: | |
| # - Create a report file in the pre_push step | |
| # - Using the GH cli command, create a new GH issue using the contents of the report file as the body | |
| # - Do this only for scheduled runs, not PRs. | |
| # | |
| # - name: Create a GitHub issue based on a broken links report | |
| # if: steps.pre_push.outcome == 'failure' | |
| # run: gh issue ... |