From 929be5b78fae72fcea4a14f4c0cf2bf30e9661d5 Mon Sep 17 00:00:00 2001 From: Andrew LeFevre Date: Sat, 29 Oct 2022 16:19:16 -0400 Subject: [PATCH] add workflow to lint workflow files --- .github/actionlint-matcher.json | 17 +++++++++++++++++ .github/workflows/lint-actions.yml | 29 +++++++++++++++++++++++++++++ .github/workflows/vuln.yml | 2 +- 3 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 .github/actionlint-matcher.json create mode 100644 .github/workflows/lint-actions.yml diff --git a/.github/actionlint-matcher.json b/.github/actionlint-matcher.json new file mode 100644 index 0000000..6887833 --- /dev/null +++ b/.github/actionlint-matcher.json @@ -0,0 +1,17 @@ +{ + "problemMatcher": [ + { + "owner": "actionlint", + "pattern": [ + { + "regexp": "^(?:\\x1b\\[\\d+m)?(.+?)(?:\\x1b\\[\\d+m)*:(?:\\x1b\\[\\d+m)*(\\d+)(?:\\x1b\\[\\d+m)*:(?:\\x1b\\[\\d+m)*(\\d+)(?:\\x1b\\[\\d+m)*: (?:\\x1b\\[\\d+m)*(.+?)(?:\\x1b\\[\\d+m)* \\[(.+?)\\]$", + "file": 1, + "line": 2, + "column": 3, + "message": 4, + "code": 5 + } + ] + } + ] +} diff --git a/.github/workflows/lint-actions.yml b/.github/workflows/lint-actions.yml new file mode 100644 index 0000000..38c110f --- /dev/null +++ b/.github/workflows/lint-actions.yml @@ -0,0 +1,29 @@ +name: Lint workflows + +on: + push: + paths: + - ".github/workflows/*" + +env: + GO_VERSION: "1.19" + +jobs: + lint-workflows: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Install Go + uses: actions/setup-go@v3 + with: + go-version: ${{ env.GO_VERSION }}.x + check-latest: true + cache: true + + - name: Lint workflow files + run: | + echo "::add-matcher::.github/actionlint-matcher.json" + go install github.com/rhysd/actionlint/cmd/actionlint@latest + actionlint diff --git a/.github/workflows/vuln.yml b/.github/workflows/vuln.yml index a5c52f9..fd00d20 100644 --- a/.github/workflows/vuln.yml +++ b/.github/workflows/vuln.yml @@ -1,4 +1,4 @@ -name: Vuln +name: Vulnerability scan on: push: