From 5ab443dd75abc45f2d5541d8b12dfe4cd042fed0 Mon Sep 17 00:00:00 2001 From: Vitor Mattos <1079143+vitormattos@users.noreply.github.com> Date: Thu, 5 Nov 2026 01:57:57 +0000 Subject: [PATCH 01/11] ci: use PHP 8.5 and reject stale published release actions Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com> --- actions/nextcloud-appstore-publish/action.yml | 17 +++++++++++++++-- tests/test_release_tool_pins.py | 7 +++++++ tests/test_release_workflow_architecture.py | 11 +++++++++++ 3 files changed, 33 insertions(+), 2 deletions(-) diff --git a/actions/nextcloud-appstore-publish/action.yml b/actions/nextcloud-appstore-publish/action.yml index 3f66b68..c15c428 100644 --- a/actions/nextcloud-appstore-publish/action.yml +++ b/actions/nextcloud-appstore-publish/action.yml @@ -40,6 +40,19 @@ inputs: runs: using: composite steps: + - name: Verify publisher action matches current catalog + shell: bash + run: | + set -euo pipefail + catalog_action="$(mktemp)" + trap 'rm -f "${catalog_action}"' EXIT + curl --fail --silent --show-error --location --retry 3 \ + https://raw.githubusercontent.com/LibreCodeCoop/.github/main/actions/nextcloud-appstore-publish/action.yml \ + --output "${catalog_action}" + if ! cmp --silent "${GITHUB_ACTION_PATH}/action.yml" "${catalog_action}"; then + echo "::error::The pinned App Store publisher differs from the current LibreCodeCoop/.github catalog. Synchronize the workflow template to refresh the immutable Action pin before releasing." + exit 1 + fi - name: Check actor permission uses: LibreCodeCoop/release-tool/actions/authorization-check@30ba5d8a33089331d829f586546d34cd45a529d7 # v0.11.21 with: @@ -255,10 +268,10 @@ runs: cd "${APP_NAME}/build/artifacts" tar -zcvf "${APP_NAME}.tar.gz" "${APP_NAME}" - - name: Set up PHP 8.3 for release-tool + - name: Set up PHP 8.5 for release-tool uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2 with: - php-version: '8.3' + php-version: '8.5' coverage: none env: GITHUB_TOKEN: ${{ inputs.github-token }} diff --git a/tests/test_release_tool_pins.py b/tests/test_release_tool_pins.py index 73f916b..fe4b1a8 100644 --- a/tests/test_release_tool_pins.py +++ b/tests/test_release_tool_pins.py @@ -22,6 +22,13 @@ def test_prepare_release_keeps_trusted_pipeline_contract(self) -> None: self.assertIn("post-merge-event: pull_request_target", content) self.assertIn('git fetch --quiet origin "+refs/heads/main:refs/remotes/origin/main"', content) + def test_publisher_blocks_stale_immutable_action_pin(self) -> None: + content = (ROOT / 'actions/nextcloud-appstore-publish/action.yml').read_text(encoding='utf-8') + self.assertIn('Verify publisher action matches current catalog', content) + self.assertIn('LibreCodeCoop/.github/main/actions/nextcloud-appstore-publish/action.yml', content) + self.assertIn('cmp --silent "${GITHUB_ACTION_PATH}/action.yml" "${catalog_action}"', content) + self.assertIn('exit 1', content) + def test_release_tool_consumers_use_same_release(self) -> None: for path in SURFACES: content = path.read_text(encoding="utf-8") diff --git a/tests/test_release_workflow_architecture.py b/tests/test_release_workflow_architecture.py index 1f90a3a..1ca00f1 100644 --- a/tests/test_release_workflow_architecture.py +++ b/tests/test_release_workflow_architecture.py @@ -43,6 +43,17 @@ def test_prepare_release_preserves_privileged_event_guards(self) -> None: self.assertIn("contains(github.event.pull_request.body, '