Skip to content

chore(deps): update actions/checkout digest to 11bd719 #100

chore(deps): update actions/checkout digest to 11bd719

chore(deps): update actions/checkout digest to 11bd719 #100

Workflow file for this run

name: hadolint
on:
pull_request:
branches:
- main
- master
paths:
- "dockerfiles/**"
- ".github/workflows/dockerfile-lint.yml"
merge_group:
jobs:
list-files:
runs-on: ubuntu-latest
outputs:
files: ${{ steps.list-files.outputs.files }}
steps:
- name: 🛎 Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: 📄 List Dockefile files
id: list-files
run: |
# git diff --name-only の結果をもとに、Dockerfile 拡張子のファイルを取得して、JSON配列として $GITHUB_OUTPUT に files として出力する
echo "files=[$(git diff --diff-filter=ACM --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} | grep -E 'Dockerfile$' | sed -r -e 's/dockerfiles\/(.+).Dockerfile/\1/' -e 's/^/"/' -e 's/$/",/' | tr -d '\n' | sed -e 's/,$//')]" >> $GITHUB_OUTPUT
lint:
runs-on: ubuntu-latest
needs: list-files
strategy:
matrix:
file: ${{ fromJson(needs.list-files.outputs.files) }}
fail-fast: false
steps:
- name: 🛎 Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Docker build check
run: |
docker build --check -f dockerfiles/${{ matrix.file }}.Dockerfile .
- name: 🐳 hadolint
uses: hadolint/hadolint-action@v3.1.0
with:
dockerfile: dockerfiles/${{ matrix.file }}.Dockerfile