mirror of
https://github.com/hadolint/hadolint-action.git
synced 2025-01-18 21:44:45 +01:00
Fix of ShellCheck and doc update. Int testing updates. Added ShellCheck action. (#3)
Co-authored-by: OCP4 migration script <deleng@atg.se>
This commit is contained in:
parent
726b0bb298
commit
218bc411d7
2 changed files with 19 additions and 12 deletions
10
.github/workflows/ci.yml
vendored
10
.github/workflows/ci.yml
vendored
|
@ -8,6 +8,11 @@ on:
|
||||||
env:
|
env:
|
||||||
TEST_IMAGE_NAME: hadolint-action:${{github.sha}}
|
TEST_IMAGE_NAME: hadolint-action:${{github.sha}}
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
issues: write # Used by Release step to update "The automated release is failing" issue
|
||||||
|
pull-requests: write # Used by ShellCheck Action to add comments on PR
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lint:
|
lint:
|
||||||
name: Lint
|
name: Lint
|
||||||
|
@ -21,9 +26,6 @@ jobs:
|
||||||
shellcheck:
|
shellcheck:
|
||||||
name: ShellCheck
|
name: ShellCheck
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
pull-requests: write
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- name: Run ShellCheck
|
- name: Run ShellCheck
|
||||||
|
@ -120,8 +122,6 @@ jobs:
|
||||||
name: Release
|
name: Release
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
needs: integration-tests
|
needs: integration-tests
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: cycjimmy/semantic-release-action@v3
|
- uses: cycjimmy/semantic-release-action@v3
|
||||||
|
|
15
hadolint.sh
15
hadolint.sh
|
@ -23,7 +23,7 @@ if [ -n "$HADOLINT_CONFIG" ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$HADOLINT_TRUSTED_REGISTRIES" ]; then
|
if [ -z "$HADOLINT_TRUSTED_REGISTRIES" ]; then
|
||||||
unset HADOLINT_TRUSTED_REGISTRIES;
|
unset HADOLINT_TRUSTED_REGISTRIES
|
||||||
fi
|
fi
|
||||||
|
|
||||||
COMMAND="hadolint $HADOLINT_CONFIG"
|
COMMAND="hadolint $HADOLINT_CONFIG"
|
||||||
|
@ -32,7 +32,6 @@ if [ "$HADOLINT_RECURSIVE" = "true" ]; then
|
||||||
shopt -s globstar
|
shopt -s globstar
|
||||||
|
|
||||||
filename="${!#}"
|
filename="${!#}"
|
||||||
|
|
||||||
flags="${*:1:$#-1}"
|
flags="${*:1:$#-1}"
|
||||||
|
|
||||||
RESULTS=$(eval "$COMMAND $flags" -- **/"$filename")
|
RESULTS=$(eval "$COMMAND $flags" -- **/"$filename")
|
||||||
|
@ -51,9 +50,17 @@ fi
|
||||||
|
|
||||||
RESULTS="${RESULTS//$'\\n'/''}"
|
RESULTS="${RESULTS//$'\\n'/''}"
|
||||||
|
|
||||||
{ echo "results<<EOF"; echo "$RESULTS"; echo "EOF"; } >> "$GITHUB_OUTPUT"
|
{
|
||||||
|
echo "results<<EOF"
|
||||||
|
echo "$RESULTS"
|
||||||
|
echo "EOF"
|
||||||
|
} >>"$GITHUB_OUTPUT"
|
||||||
|
|
||||||
{ echo "HADOLINT_RESULTS<<EOF"; echo "$RESULTS"; echo "EOF"; } >> "$GITHUB_ENV"
|
{
|
||||||
|
echo "HADOLINT_RESULTS<<EOF"
|
||||||
|
echo "$RESULTS"
|
||||||
|
echo "EOF"
|
||||||
|
} >>"$GITHUB_ENV"
|
||||||
|
|
||||||
[ -z "$HADOLINT_OUTPUT" ] || echo "Hadolint output saved to: $HADOLINT_OUTPUT"
|
[ -z "$HADOLINT_OUTPUT" ] || echo "Hadolint output saved to: $HADOLINT_OUTPUT"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue