2024-08-21 07:13:07 -05:00
|
|
|
name: Dispatch event
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
tags:
|
|
|
|
- '!**'
|
|
|
|
|
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
actions: write
|
|
|
|
|
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
|
|
|
env:
|
|
|
|
ASTRO_ADAPTERS_REPO: withastro/adapters
|
|
|
|
ASTRO_STARLIGHT_REPO: withastro/starlight
|
2024-08-21 07:51:55 -05:00
|
|
|
ASTRO_PUSH_MAIN_EVENT: astro-push-main-event
|
2024-08-21 07:13:07 -05:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
repository-dispatch:
|
|
|
|
name: Repository dispatch
|
2024-10-04 07:06:16 -05:00
|
|
|
if: github.repository_owner == 'withastro'
|
2024-08-21 07:13:07 -05:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Dispatch event on push - adapters
|
|
|
|
if: ${{ github.event_name == 'push' }}
|
|
|
|
uses: peter-evans/repository-dispatch@ff45666b9427631e3450c54a1bcbee4d9ff4d7c0 # v3
|
|
|
|
with:
|
|
|
|
token: ${{ secrets.ASTRO_REPOSITORY_DISPATCH }}
|
|
|
|
repository: ${{ env.ASTRO_ADAPTERS_REPO }}
|
|
|
|
event-type: ${{ env.ASTRO_PUSH_MAIN_EVENT }}
|
|
|
|
client-payload: '{"event": ${{ toJson(github.event) }}}'
|
|
|
|
- name: Dispatch event on push - starlight
|
|
|
|
if: ${{ github.event_name == 'push' }}
|
|
|
|
uses: peter-evans/repository-dispatch@ff45666b9427631e3450c54a1bcbee4d9ff4d7c0 # v3
|
|
|
|
with:
|
|
|
|
token: ${{ secrets.ASTRO_REPOSITORY_DISPATCH }}
|
|
|
|
repository: ${{ env.ASTRO_STARLIGHT_REPO }}
|
|
|
|
event-type: ${{ env.ASTRO_PUSH_MAIN_EVENT }}
|
|
|
|
client-payload: '{"event": ${{ toJson(github.event) }}}'
|
|
|
|
# For testing only, the payload is mocked
|
|
|
|
- name: Dispatch event on workflow dispatch - adapters
|
|
|
|
if: ${{ github.event_name == 'workflow_dispatch' }}
|
|
|
|
uses: peter-evans/repository-dispatch@ff45666b9427631e3450c54a1bcbee4d9ff4d7c0 # v3
|
|
|
|
with:
|
|
|
|
token: ${{ secrets.ASTRO_REPOSITORY_DISPATCH }}
|
|
|
|
repository: ${{ env.ASTRO_ADAPTERS_REPO }}
|
|
|
|
event-type: ${{ env.ASTRO_PUSH_MAIN_EVENT }}
|
|
|
|
client-payload: '{"event": {"head_commit": {"id": "${{ env.GITHUB_SHA }}"}}}'
|
|
|
|
- name: Dispatch event on workflow dispatch - starlight
|
|
|
|
if: ${{ github.event_name == 'workflow_dispatch' }}
|
|
|
|
uses: peter-evans/repository-dispatch@ff45666b9427631e3450c54a1bcbee4d9ff4d7c0 # v3
|
|
|
|
with:
|
|
|
|
token: ${{ secrets.ASTRO_REPOSITORY_DISPATCH }}
|
|
|
|
repository: ${{ env.ASTRO_STARLIGHT_REPO }}
|
|
|
|
event-type: ${{ env.ASTRO_PUSH_MAIN_EVENT }}
|
|
|
|
client-payload: '{"event": {"head_commit": {"id": "${{ env.GITHUB_SHA }}"}}}'
|