v0.10.0 #2
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Notify agent-pane | |
| # Push-model dependency sync: poke copse-dev/agent-pane with a | |
| # repository_dispatch so its sync-streaming-markdown.yml workflow bumps | |
| # @copse/streaming-markdown and opens a PR immediately — no waiting for | |
| # dependabot's weekly schedule and cooldown. | |
| # | |
| # This workflow fires on: | |
| # * release: published — covers releases cut BY HAND in the GitHub UI. | |
| # Note it does NOT cover releases cut by release.yml: those are published | |
| # with the default GITHUB_TOKEN, and GitHub deliberately does not fire the | |
| # `release: published` event for actions taken with GITHUB_TOKEN (an | |
| # anti-recursion safeguard). The automated release path therefore dispatches | |
| # agent-pane directly from a step in release.yml instead. | |
| # * workflow_dispatch — a manual escape hatch to (re)notify agent-pane for | |
| # any tag, e.g. to replay a dispatch that failed or to sync an older tag. | |
| # | |
| # GITHUB_TOKEN is scoped to this repo and cannot dispatch cross-repo, so this | |
| # needs a fine-grained PAT stored as the AGENT_PANE_DISPATCH_TOKEN repo secret: | |
| # github.com -> Settings -> Developer settings -> Fine-grained tokens | |
| # Repository access: copse-dev/agent-pane only | |
| # Permissions: Contents -> Read and write (the repository_dispatch endpoint | |
| # sits under Contents) | |
| # A GitHub App installation token works too if PAT expiry rotation is a | |
| # concern. Until the secret exists this workflow simply fails on its one step, | |
| # and releases themselves are unaffected. | |
| on: | |
| release: | |
| types: [published] | |
| workflow_dispatch: | |
| inputs: | |
| tag: | |
| description: 'Release tag to notify agent-pane about (e.g. v0.9.0)' | |
| required: true | |
| type: string | |
| # The job only calls the API on the *other* repo via the PAT; this workflow | |
| # needs nothing from its own GITHUB_TOKEN. | |
| permissions: {} | |
| jobs: | |
| dispatch: | |
| # Deliberately NOT routed to the self-hosted pool: one API call, free on a | |
| # public repo, and release notifications shouldn't depend on fleet uptime. | |
| runs-on: ubuntu-latest | |
| # Pre-releases are opt-in on the consumer side — don't auto-bump agent-pane | |
| # onto an 0.x.y-rc. A manual workflow_dispatch always proceeds (github.event | |
| # .release is absent there, so the prerelease check is release-only). | |
| if: ${{ github.event_name == 'workflow_dispatch' || !github.event.release.prerelease }} | |
| steps: | |
| - name: Send repository_dispatch to agent-pane | |
| env: | |
| GH_TOKEN: ${{ secrets.AGENT_PANE_DISPATCH_TOKEN }} | |
| # release event supplies tag_name; manual runs supply inputs.tag. | |
| TAG: ${{ github.event.release.tag_name || inputs.tag }} | |
| run: | | |
| set -euo pipefail | |
| VERSION="${TAG#v}" | |
| gh api repos/copse-dev/agent-pane/dispatches \ | |
| -f event_type=streaming-markdown-release \ | |
| -f "client_payload[version]=$VERSION" \ | |
| -f "client_payload[tag]=$TAG" | |
| echo "Dispatched streaming-markdown-release $VERSION to copse-dev/agent-pane" |