diff --git a/.github/workflows/node-fleet-check.yml b/.github/workflows/node-fleet-check.yml index 2bf7f9e..ce8e88d 100644 --- a/.github/workflows/node-fleet-check.yml +++ b/.github/workflows/node-fleet-check.yml @@ -1,5 +1,12 @@ name: Node maintenance setup check 'on': + push: + branches: [main] + paths: + - .github/workflows/node-*.yml + - defaults/node-maintenance.json + - defaults/node-repositories.json + - node/** schedule: - cron: '0 3 * * 1' workflow_call: diff --git a/docs/node-fleet-setup.md b/docs/node-fleet-setup.md index 2e3057e..d142477 100644 --- a/docs/node-fleet-setup.md +++ b/docs/node-fleet-setup.md @@ -209,6 +209,13 @@ run to exercise installation, project checks, and publication. ## Change the weekly schedule +This repository also runs its setup check after pushes to `main` that change +`.github/workflows/node-*.yml`, `node/**`, `defaults/node-maintenance.json`, or +`defaults/node-repositories.json`. These triggers observe changes in this host; +the periodic scan still covers changes in the listed repositories. Other hosts +can add a push trigger for their own workflow and inventory paths while keeping +their existing schedule and manual trigger. + This repository checks its inventory every Monday at 03:00 UTC (11:00 in Singapore). The caller example above uses the same weekly schedule. To change it, edit the `schedule` block in the host workflow: @@ -220,8 +227,8 @@ To change it, edit the `schedule` block in the host workflow: workflow_dispatch: ``` -Remove the `schedule` block to run only manually. Keep `workflow_dispatch` for -on-demand checks. A reusable workflow uses its caller's schedule; it does not -inherit this repository's cron. This schedule is independent of the security -and upgrade cadences in each maintenance installation; do not add the fleet +Remove the `schedule` and `push` blocks, if present, to run only manually. Keep +`workflow_dispatch` for on-demand checks. A reusable workflow uses its caller's +schedule; it does not inherit this repository's cron. This schedule is independent +of the security and upgrade cadences in each maintenance installation; do not add the fleet cron to those installations' maintenance configuration. diff --git a/node/tests/test_fleet_setup.py b/node/tests/test_fleet_setup.py index ec59d73..6c7f293 100644 --- a/node/tests/test_fleet_setup.py +++ b/node/tests/test_fleet_setup.py @@ -786,7 +786,18 @@ def test_workflow_splits_read_access_and_host_issue_write_access(): workflow = yaml.safe_load( (ROOT / ".github/workflows/node-fleet-check.yml").read_text() ) - assert {"workflow_call", "workflow_dispatch", "schedule"} == set(workflow["on"]) + assert {"workflow_call", "workflow_dispatch", "schedule", "push"} == set( + workflow["on"] + ) + assert workflow["on"]["push"] == { + "branches": ["main"], + "paths": [ + ".github/workflows/node-*.yml", + "defaults/node-maintenance.json", + "defaults/node-repositories.json", + "node/**", + ], + } assert workflow["on"]["schedule"] == [{"cron": "0 3 * * 1"}] assert workflow["name"] == "Node maintenance setup check" assert workflow["jobs"]["check"]["steps"][0]["with"]["inventory-path"] == (