From 23ff87ffd21153c5fcbf2d912be232dceb2ec066 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johan=20Bergstro=CC=88m?= Date: Sat, 4 Sep 2021 15:51:37 -0400 Subject: [PATCH] feat: check github action syntax with actionlint --- .github/workflows/lint-actionlint.yml | 21 +++++++++++++++++++++ .github/workflows/test.yml | 4 +--- 2 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/lint-actionlint.yml diff --git a/.github/workflows/lint-actionlint.yml b/.github/workflows/lint-actionlint.yml new file mode 100644 index 0000000..06daf8d --- /dev/null +++ b/.github/workflows/lint-actionlint.yml @@ -0,0 +1,21 @@ +name: lint +on: + pull_request: + paths: + - ".github/workflows/*.yml" + +jobs: + actionlint: + name: actionlint + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2.3.4 + - name: Install Actionlint + env: + ACTIONLINT_VERSION: 1.6.3 + run: | + wget -q -O- "https://github.com/rhysd/actionlint/releases/download/v${ACTIONLINT_VERSION}/actionlint_${ACTIONLINT_VERSION}_linux_amd64.tar.gz" | tar -x -z -C . actionlint && \ + mv actionlint /usr/local/bin + - name: Run Actionlint + run: | + actionlint -format '{{range $err := .}}::error file={{$err.Filepath}},line={{$err.Line}},col={{$err.Column}}::{{$err.Message}}{{end}}' -ignore 'SC2016:' .github/workflows/*.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5644842..da7c74b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,7 +8,7 @@ jobs: steps: - uses: actions/checkout@v2.3.4 - name: fetch hadolint version - run: echo "HADOLINT_VERSION=$(cat HADOLINT_VERSION)" >> ${GITHUB_ENV} + run: echo "HADOLINT_VERSION=$(cat HADOLINT_VERSION)" >> "${GITHUB_ENV}" - name: install hadolint run: | wget -q -O hadolint https://github.com/hadolint/hadolint/releases/download/v${{ env.HADOLINT_VERSION }}/hadolint-Linux-x86_64 && \ @@ -26,5 +26,3 @@ jobs: bash_unit -v - name: run suite run: bash_unit test/*.sh - env: - VERSION: ${{ steps.assign.outputs.version }}