Skip to content

Commit

Permalink
chore(docs): update examples
Browse files Browse the repository at this point in the history
Update examples to use latest versions of actions so its more
friendly for copy pasting.

Also, check for typos in CI.
  • Loading branch information
jbergstroem committed Feb 2, 2024
1 parent 78f31aa commit 6bf927d
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 12 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand Down
20 changes: 10 additions & 10 deletions USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
```

Expand All @@ -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.
Expand All @@ -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: |
Expand Down
2 changes: 1 addition & 1 deletion lib/main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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:-"."}

Expand Down

0 comments on commit 6bf927d

Please sign in to comment.