-
-
Notifications
You must be signed in to change notification settings - Fork 541
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Add hadolint check for Dockerfiles (#322)
Co-authored-by: Balazs Hamorszky <[email protected]>
- Loading branch information
1 parent
321fb16
commit 4722900
Showing
6 changed files
with
46 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,19 +25,32 @@ jobs: | |
- name: Install shellcheck | ||
run: | | ||
sudo apt update && sudo apt install shellcheck | ||
- name: Install hadolint | ||
run: | | ||
curl -L "$(curl -s https://api.github.com/repos/hadolint/hadolint/releases/latest | grep -o -E -m 1 "https://.+?/hadolint-Linux-x86_64")" > hadolint \ | ||
&& chmod +x hadolint && sudo mv hadolint /usr/bin/ | ||
# Need to success pre-commit fix push | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
|
||
# Skip terraform_tflint which interferes to commit pre-commit auto-fixes | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.9' | ||
- name: Execute pre-commit | ||
uses: pre-commit/[email protected] | ||
env: | ||
SKIP: no-commit-to-branch | ||
SKIP: no-commit-to-branch,hadolint | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
extra_args: --color=always --show-diff-on-failure --files ${{ steps.file_changes.outputs.files }} | ||
# Run only skipped checks | ||
- name: Execute pre-commit check that have no auto-fixes | ||
if: always() | ||
uses: pre-commit/[email protected] | ||
env: | ||
SKIP: check-added-large-files,check-merge-conflict,check-vcs-permalinks,forbid-new-submodules,no-commit-to-branch,end-of-file-fixer,trailing-whitespace,check-yaml,check-merge-conflict,check-executables-have-shebangs,check-case-conflict,mixed-line-ending,detect-aws-credentials,detect-private-key,shfmt,shellcheck | ||
with: | ||
extra_args: --color=always --show-diff-on-failure --files ${{ steps.file_changes.outputs.files }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM pre-commit | ||
FROM pre-commit-terraform:latest | ||
|
||
RUN apt update && \ | ||
apt install -y \ | ||
|