coder / coder

Provision remote development environments via Terraform
https://coder.com
GNU Affero General Public License v3.0
7.31k stars 591 forks source link

ci: set up a github workflows linter #13413

Closed matifali closed 7 hours ago

matifali commented 3 weeks ago

As a follow-up, I think we should look into a github action linter to catch these problems pre-merge in the future.

Thanks for fixing @matifali 👍

Originally posted by @dannykopping in https://github.com/coder/coder/pull/13412#pullrequestreview-2087660703

matifali commented 3 weeks ago

We can borrow this snippet from https://github.com/coder/code-server

lint-actions:
    name: Lint GitHub Actions
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repo
        uses: actions/checkout@v4
      - name: Check workflow files
        run: |
          bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/7fdc9630cc360ea1a469eed64ac6d78caeda1234/scripts/download-actionlint.bash)
          ./actionlint -color -shellcheck= -ignore "set-output"
        shell: bash
dannykopping commented 3 weeks ago

Sounds good! Will you raise a PR?

matifali commented 3 weeks ago

I would be happy if you could take it up. We can also make it part of make lint they have a go package go install github.com/rhysd/actionlint/cmd/actionlint@latest