fix(ci): make droast job actually run
PR Check / Security scan (Snyk) (pull_request) Skipped
PR Check / ESLint (pull_request) Successful in 35s
PR Check / Typecheck (pull_request) Successful in 37s
PR Check / Secret scan (gitleaks) (pull_request) Successful in 5s
PR Check / Dependency audit (pull_request) Failing after 9s
PR Check / Dockerfile lint (droast) (pull_request) Failing after 5s
PR Check / AI code review (opencode) (pull_request) Failing after 12s
PR Check / Security scan (Snyk) (pull_request) Skipped
PR Check / ESLint (pull_request) Successful in 35s
PR Check / Typecheck (pull_request) Successful in 37s
PR Check / Secret scan (gitleaks) (pull_request) Successful in 5s
PR Check / Dependency audit (pull_request) Failing after 9s
PR Check / Dockerfile lint (droast) (pull_request) Failing after 5s
PR Check / AI code review (opencode) (pull_request) Failing after 12s
The dockerfile-lint job skipped on every PR despite Dockerfiles existing: the act runner's hashFiles() evaluation returned empty. Replace it with an explicit file-discovery step. Also run the droast binary in node:22-bookworm (arch-aware install) instead of the vendor image, which ships no node and would fail actions/checkout with exit 127 - same failure mode as the gitleaks image.
This commit is contained in:
1 parent
5f1d64db90
commit
cf6f209ebf
1 file changed
+35
-4
@@ -116,14 +116,45 @@ jobs:
|
|||||||
dockerfile-lint:
|
dockerfile-lint:
|
||||||
name: Dockerfile lint (droast)
|
name: Dockerfile lint (droast)
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
# droast's own container image ships no node (actions/checkout would
|
||||||
image: immanuwell/droast:1.7.0
|
# fail with exit 127 - same as the gitleaks image), so run the droast
|
||||||
# skips until the repo contains a Dockerfile
|
# binary in the multi-arch node image instead
|
||||||
if: ${{ hashFiles('**/Dockerfile', '**/Dockerfile.*', '**/Containerfile') != '' }}
|
container: node:22-bookworm
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Install droast
|
||||||
|
run: |
|
||||||
|
case "$(uname -m)" in
|
||||||
|
x86_64) DROAST_ASSET=droast-linux-x86_64 ;;
|
||||||
|
aarch64) DROAST_ASSET=droast-linux-arm64 ;;
|
||||||
|
*) echo "unsupported arch: $(uname -m)" && exit 1 ;;
|
||||||
|
esac
|
||||||
|
curl -fsSL -o /usr/local/bin/droast \
|
||||||
|
"https://github.com/immanuwell/dockerfile-roast/releases/download/1.7.0/${DROAST_ASSET}"
|
||||||
|
chmod +x /usr/local/bin/droast
|
||||||
|
droast --version
|
||||||
|
|
||||||
|
- name: Discover Dockerfiles
|
||||||
|
id: discover
|
||||||
|
# shell check instead of hashFiles: the act runner's hashFiles
|
||||||
|
# evaluation returned empty and silently skipped the job even when
|
||||||
|
# Dockerfiles existed
|
||||||
|
run: |
|
||||||
|
found="$(find . \
|
||||||
|
-path ./.git -prune -o -path ./node_modules -prune -o \
|
||||||
|
-type f \( -iname 'Dockerfile*' -o -iname '*dockerfile' -o -iname 'Containerfile*' \) \
|
||||||
|
-print | head -n 1)"
|
||||||
|
if [ -n "$found" ]; then
|
||||||
|
echo "found=true" >> "$GITHUB_OUTPUT"
|
||||||
|
echo "Dockerfile found: $found"
|
||||||
|
else
|
||||||
|
echo "found=false" >> "$GITHUB_OUTPUT"
|
||||||
|
echo "No Dockerfile in repo - nothing to lint"
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Lint Dockerfile(s)
|
- name: Lint Dockerfile(s)
|
||||||
|
if: ${{ steps.discover.outputs.found == 'true' }}
|
||||||
run: |
|
run: |
|
||||||
# --no-roast = technical output for CI; --min-severity warning so
|
# --no-roast = technical output for CI; --min-severity warning so
|
||||||
# info-level findings don't block the PR
|
# info-level findings don't block the PR
|
||||||
|
|||||||
Reference in new issue
Block a user