Skip to content

chore(deps): actions/checkout v4 #206

chore(deps): actions/checkout v4

chore(deps): actions/checkout v4 #206

Workflow file for this run

name: Lint
on:
pull_request:
paths:
# actionlint
- ".github/workflows/*.yml"
# prettier
- "**.md"
- "**.yml"
- "**.json"
# shellcheck & shfmt
- "**.sh"
jobs:
validate-renovate-config:
name: Validate renovate config
runs-on: ubuntu-22.04
container:
image: renovate/renovate:slim
env:
SERVER_URL: ${{ github.server_url }}
REPO_URL: ${{ github.repository }}
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
steps:
- name: Fetch config from branch
# TODO Find a way to mount the file via `volumes` or `options`
# `raw.githubusercontent.com` has a 5min cache timeout which is undesirable
# should a PR be about testing renovate configs.
#
# During the PR lifecycle, many permutations of volume mounting was tried -
# but the only option that worked was a DinD approach, which is much slower
# (almost back at old performance).
#
# A final option could be to upstream a PR that checks in a package-lock so
# a hash can be used (for the previous action used).
run: curl -Ls -o /tmp/renovate.json "${SERVER_URL}/${REPO_URL}/raw/${BRANCH_NAME}/.github/renovate.json"
- name: Validate config
run: renovate-config-validator /tmp/renovate.json
actionlint:
name: Actionlint
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Install Actionlint
env:
version: "1.6.25"
run: curl -Ls "https://github.com/rhysd/actionlint/releases/download/v${{ env.version }}/actionlint_${{ env.version }}_linux_amd64.tar.gz" | sudo tar -x -z -C /usr/local/bin actionlint
- name: Run Actionlint
run: |
echo "::add-matcher::.github/matcher-actionlint.json"
actionlint -color
prettier:
runs-on: ubuntu-22.04
name: Prettier
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: "20"
- name: Install prettier
run: npm install -g prettier
- name: Run prettier
run: prettier -c .
shellcheck:
runs-on: ubuntu-22.04
name: Shellcheck
steps:
- uses: actions/checkout@v4
- name: Install Shellcheck
env:
version: "0.9.0"
run: curl -Ls "https://github.com/koalaman/shellcheck/releases/download/v${{ env.version }}/shellcheck-v${{ env.version }}.linux.x86_64.tar.xz" | sudo tar -x -J --wildcards --strip-components=1 -C /usr/local/bin "shellcheck*/shellcheck"
- name: Verify shell scripts
run: |
echo "::add-matcher::.github/matcher-shellcheck.json"
shellcheck -f gcc -S warning hadolint.sh lib/*.sh test/*.sh
shfmt:
name: Shfmt
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Install shfmt
env:
version: "3.7.0"
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 lib/*.sh test/*.sh