From 237df4449a8962139e363d82bbb90d7593d90f34 Mon Sep 17 00:00:00 2001 From: Michael Kantor <6068672+kantorcodes@users.noreply.github.com> Date: Mon, 30 Mar 2026 12:50:54 -0400 Subject: [PATCH] fix: make action publish workflow dispatchable Signed-off-by: Michael Kantor <6068672+kantorcodes@users.noreply.github.com> --- .github/workflows/publish-action-repo.yml | 8 +++++++- tests/test_action_bundle.py | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish-action-repo.yml b/.github/workflows/publish-action-repo.yml index 914a9d0..658bd25 100644 --- a/.github/workflows/publish-action-repo.yml +++ b/.github/workflows/publish-action-repo.yml @@ -29,7 +29,6 @@ concurrency: jobs: publish-action-repo: name: Publish GitHub Action Repository - if: secrets.ACTION_REPO_TOKEN != '' runs-on: ubuntu-latest env: GH_TOKEN: ${{ secrets.ACTION_REPO_TOKEN }} @@ -44,6 +43,13 @@ jobs: ref: ${{ github.event.release.tag_name || inputs.release_tag || github.ref }} fetch-depth: 0 + - name: Validate publication credentials + run: | + if [ -z "${GH_TOKEN}" ]; then + echo "ACTION_REPO_TOKEN is required to publish the GitHub Action repository." >&2 + exit 1 + fi + - name: Resolve version id: version run: | diff --git a/tests/test_action_bundle.py b/tests/test_action_bundle.py index e0389c9..511da12 100644 --- a/tests/test_action_bundle.py +++ b/tests/test_action_bundle.py @@ -34,6 +34,8 @@ def test_publish_action_repo_workflow_syncs_action_repository() -> None: assert "Publish GitHub Action Repository" in workflow_text assert "ACTION_REPO_TOKEN" in workflow_text assert "hashgraph-online/hol-codex-plugin-scanner-action" in workflow_text + assert "Validate publication credentials" in workflow_text + assert 'if: secrets.ACTION_REPO_TOKEN != \'\'' not in workflow_text assert 'gh repo create "${ACTION_REPOSITORY}"' in workflow_text assert 'cp "${GITHUB_WORKSPACE}/action/action.yml" action.yml' in workflow_text assert 'git push origin refs/tags/v1 --force' in workflow_text