Skip to content

Check Drift Against Poweradmin #5

Check Drift Against Poweradmin

Check Drift Against Poweradmin #5

Workflow file for this run

name: Check Drift Against Poweradmin
# Scheduled rather than blocking: this drift is caused by changes in the
# poweradmin repo, not by the docs commit under test, so it must not fail a
# deploy. Same reasoning as the external link check.
on:
schedule:
- cron: '0 7 * * 1' # Mondays, 07:00 UTC
workflow_dispatch:
permissions:
contents: read
jobs:
drift:
runs-on: ubuntu-latest
steps:
- name: Checkout docs
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Checkout poweradmin
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: poweradmin/poweradmin
path: poweradmin
# develop, not master: the site documents the current release line,
# which is ahead of the latest tag (develop is 4.5.0, master 4.4.1).
ref: develop
- name: Settings reference is current
run: |
python3 scripts/gen_settings_reference.py \
--settings poweradmin/config/settings.defaults.php \
--version "$(grep -oE "'[0-9]+\.[0-9]+\.[0-9]+'" poweradmin/lib/Version.php | head -1 | tr -d "'")" \
--out docs/configuration/settings-reference.md --check
# The OpenAPI spec is committed here so local builds and deploys need no
# PHP. Regenerating it weekly is what keeps that copy honest.
- name: Set up PHP
if: always()
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2
with:
php-version: '8.2'
- name: OpenAPI spec is current
if: always()
working-directory: poweradmin
run: |
composer install --prefer-dist --no-progress --quiet
vendor/bin/openapi lib/Application/Controller/Api/V2/ --output /tmp/openapi.json
if ! diff -q /tmp/openapi.json ../docs/api/openapi.json >/dev/null; then
echo "::error::docs/api/openapi.json is stale; regenerate it from the poweradmin source"
diff /tmp/openapi.json ../docs/api/openapi.json | head -40
exit 1
fi
echo "docs/api/openapi.json matches the source annotations"
# DOCKER.md lives in the code repo by design; this only reports on it.
- name: Docker variables are documented
if: always()
run: |
python3 scripts/check_docker_env.py \
--entrypoint poweradmin/docker-entrypoint.sh \
--docs poweradmin/DOCKER.md