From 6bf927dbee9a0a80f18aadda6fcc90773c12590c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johan=20Bergstro=CC=88m?= Date: Fri, 2 Feb 2024 20:23:40 -0300 Subject: [PATCH] chore(docs): update examples Update examples to use latest versions of actions so its more friendly for copy pasting. Also, check for typos in CI. --- .github/workflows/lint.yml | 7 +++++++ README.md | 2 +- USAGE.md | 20 ++++++++++---------- lib/main.sh | 2 +- 4 files changed, 19 insertions(+), 12 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 1061f09..6173239 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -65,3 +65,10 @@ jobs: run: curl -Ls -o shfmt "https://github.com/mvdan/sh/releases/download/v${{ env.version }}/shfmt_v${{ env.version }}_linux_amd64" && chmod +x shfmt && sudo mv shfmt /usr/local/bin - name: Lint shell scripts run: shfmt -i 2 -d hadolint.sh install.sh lib/*.sh test/*.sh + typos: + name: Typos + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - name: Check for typos + uses: crate-ci/typos@v1.18.0 diff --git a/README.md b/README.md index 9ee948c..024b79b 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-22.04 name: Hadolint steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: jbergstroem/hadolint-gh-action@v1 ``` diff --git a/USAGE.md b/USAGE.md index 5aaeca7..270912c 100644 --- a/USAGE.md +++ b/USAGE.md @@ -16,9 +16,9 @@ on: pull_request jobs: hadolint: runs-on: ubuntu-22.04 - name: "Hadolint" + name: Hadolint steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: jbergstroem/hadolint-gh-action@v1 with: # ignore warnings (but still fail on errors) from hadolint @@ -51,9 +51,9 @@ on: jobs: hadolint: runs-on: ubuntu-22.04 - name: "Hadolint" + name: Hadolint steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: jbergstroem/hadolint-gh-action@v1 ``` @@ -79,15 +79,15 @@ on: pull_request jobs: hadolint: runs-on: ubuntu-22.04 - name: "Hadolint" + name: Hadolint" steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: jbergstroem/hadolint-gh-action@v1 with: dockerfile: "Dockerfile path/to/my/other/Dockerfile" ``` -### Only pass Dockerfiles that are changes in the PR +### Only pass Dockerfiles that are changed in the PR In certain use-cases – for instance when you have a monorepo with a lot of Dockerfiles; you may only want to pass the files that are changed in the PR. This would make processing faster. @@ -102,12 +102,12 @@ on: pull_request jobs: hadolint: runs-on: ubuntu-22.04 - name: "Hadolint" + name: Hadolint steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Get changed files id: changed-files - uses: tj-actions/changed-files@v9.3 + uses: tj-actions/changed-files@v42 with: # Pass what names/filters you want to catch files: | diff --git a/lib/main.sh b/lib/main.sh index 7eb403e..9613722 100644 --- a/lib/main.sh +++ b/lib/main.sh @@ -8,7 +8,7 @@ OUTPUT_FORMAT=${output_format:-} HADOLINT_PATH=${hadolint_path:-"hadolint"} # https://docs.github.com/en/actions/learn-github-actions/environment-variables#default-environment-variables CI=${GITHUB_ACTIONS:-"false"} -# This variable is magic in workflows; it intercepts output and makes it availble across jobs +# This variable is magic in workflows; it intercepts output and makes it available across jobs GITHUB_OUTPUT=${GITHUB_OUTPUT:-/dev/null} MATCHER_PREFIX=${GITHUB_ACTION_PATH:-"."}