All checks were successful
renovate / renovate (push) Successful in 1m51s
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [GuillaumeFalourd/branch-exists](https://github.com/GuillaumeFalourd/branch-exists) | action | minor | `v1.1` → `v1.2` | --- ### Release Notes <details> <summary>GuillaumeFalourd/branch-exists (GuillaumeFalourd/branch-exists)</summary> ### [`v1.2`](https://github.com/GuillaumeFalourd/branch-exists/releases/tag/v1.2) [Compare Source](https://github.com/GuillaumeFalourd/branch-exists/compare/v1.1...v1.2) Update actions/checkout to v6.0.2. </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My44NC4yIiwidXBkYXRlZEluVmVyIjoiNDMuODQuMiIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==--> Reviewed-on: #5041 Co-authored-by: Renovate Bot <renovate-bot@alexlebens.net> Co-committed-by: Renovate Bot <renovate-bot@alexlebens.net>
135 lines
4.1 KiB
YAML
135 lines
4.1 KiB
YAML
name: lint-test-docker
|
|
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- 'hosts/**'
|
|
|
|
push:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- 'hosts/**'
|
|
|
|
env:
|
|
BASE_BRANCH: "origin/${{ github.base_ref }}"
|
|
|
|
jobs:
|
|
lint-docker-compose:
|
|
runs-on: ubuntu-js
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Check Branch Exists
|
|
id: check-branch-exists
|
|
if: github.event_name == 'pull_request'
|
|
uses: GuillaumeFalourd/branch-exists@650358876c774d6ccbd581b5553eb636dab79a97 # v1.2
|
|
with:
|
|
branch: "${{ github.base_ref }}"
|
|
|
|
- name: Report Branch Exists
|
|
id: branch-exists
|
|
if: github.event_name == 'push' || steps.check-branch-exists.outputs.exists == 'true' && github.event_name == 'pull_request'
|
|
run: |
|
|
if [ "${{ github.event_name }}" == "push" ]; then
|
|
echo ">> Action is from a push event, will continue with linting"
|
|
|
|
else
|
|
echo ">> Branch ${{ github.base_ref }} exists, will continue with linting"
|
|
|
|
fi
|
|
|
|
echo ""
|
|
echo "----"
|
|
|
|
echo "exists=true" >> $GITHUB_OUTPUT
|
|
|
|
- name: Set Up Node.js
|
|
if: steps.branch-exists.outputs.exists == 'true'
|
|
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
|
|
with:
|
|
node-version: '24'
|
|
|
|
- name: Check Directories for Changes
|
|
id: check-dir-changes
|
|
if: steps.branch-exists.outputs.exists == 'true'
|
|
run: |
|
|
echo ">> Target branch for diff is: ${BASE_BRANCH}"
|
|
|
|
if [ "${{ github.event_name }}" == "pull_request" ]; then
|
|
DIFF_TARGET="${BASE_BRANCH}"
|
|
echo ""
|
|
echo ">> Checking for changes in a pull request ..."
|
|
|
|
else
|
|
DIFF_TARGET="${{ github.event.before }}..HEAD"
|
|
echo ""
|
|
echo ">> Checking for changes from a push ..."
|
|
|
|
fi
|
|
|
|
CHANGED_COMPOSE=$(git diff --name-only "${DIFF_TARGET}" | grep -E "^hosts/[^/]+/[^/]+/" | cut -d/ -f1,2,3 | sort -u || true)
|
|
|
|
if [ -n "${CHANGED_COMPOSE}" ]; then
|
|
echo ""
|
|
echo ">> Compose to Lint:"
|
|
echo ""
|
|
echo "${CHANGED_COMPOSE}"
|
|
|
|
CHANGED_COMPOSE_CSV=$(echo "$CHANGED_COMPOSE" | paste -sd ',' -)
|
|
|
|
echo ""
|
|
echo "----"
|
|
|
|
echo "changes-detected=true" >> $GITHUB_OUTPUT
|
|
echo "compose-dir-csv=${CHANGED_COMPOSE_CSV}" >> $GITHUB_OUTPUT
|
|
echo "compose-dir<<EOF" >> $GITHUB_OUTPUT
|
|
echo "${CHANGED_COMPOSE}" >> $GITHUB_OUTPUT
|
|
echo "EOF" >> $GITHUB_OUTPUT
|
|
|
|
else
|
|
echo ""
|
|
echo ">> Did not find any docker compose files to lint"
|
|
|
|
echo ""
|
|
echo "----"
|
|
|
|
echo "changes-detected=false" >> $GITHUB_OUTPUT
|
|
|
|
fi
|
|
|
|
- name: Lint Docker Compose
|
|
if: steps.check-dir-changes.outputs.changes-detected == 'true'
|
|
env:
|
|
CHANGED_COMPOSE: ${{ steps.check-dir-changes.outputs.compose-dir }}
|
|
run: |
|
|
echo ">> Running dclint on changed compose files ..."
|
|
|
|
for COMPOSE in $CHANGED_COMPOSE; do
|
|
echo ">> Linting ${COMPOSE} ..."
|
|
npx dclint ${COMPOSE}
|
|
|
|
done
|
|
|
|
echo ""
|
|
echo "----"
|
|
|
|
- name: ntfy Failed
|
|
uses: niniyas/ntfy-action@96acac57fdc91d4c4f50b78486c1ed6f03f9f61c # master
|
|
if: failure()
|
|
with:
|
|
url: '${{ secrets.NTFY_URL }}'
|
|
topic: '${{ secrets.NTFY_TOPIC }}'
|
|
title: 'Docker Compose Test Failure'
|
|
priority: 3
|
|
headers: '{"Authorization": "Bearer ${{ secrets.NTFY_CRED }}"}'
|
|
tags: action,failed
|
|
details: "Docker linting for compose dirs: ${{ steps.check-dir-changes.outputs.compose-dir-csv }}"
|
|
icon: 'https://cdn.jsdelivr.net/gh/selfhst/icons/png/gitea.png'
|
|
actions: '[{"action": "view", "label": "View Logs", "url": "${{ vars.USER_URL }}/${{ github.repository }}/actions/runs/${{ github.run_id }}", "clear": true}]'
|