Skip to content

Improve the Vercel & Slack integration settings pages (#4848) #8

Improve the Vercel & Slack integration settings pages (#4848)

Improve the Vercel & Slack integration settings pages (#4848) #8

name: Dispatch RepoOps sync
on:
push:
branches: [main]
workflow_dispatch:
permissions:
contents: read
concurrency:
group: dispatch-repo-ops-sync
cancel-in-progress: false
jobs:
dispatch:
if: vars.REPO_OPS_SYNC_ENABLED == 'true'
runs-on: ubuntu-latest
steps:
- name: Create Dispatcher App token
id: app-token
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
with:
app-id: ${{ vars.REPO_OPS_DISPATCHER_APP_ID }}
private-key: ${{ secrets.REPO_OPS_DISPATCHER_APP_PRIVATE_KEY }}
repositories: ${{ secrets.REPO_OPS_MONO_REPOSITORY }}
permission-contents: write
- name: Dispatch the private sync worker
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
PUBLIC_SHA: ${{ github.sha }}
MONO_REPOSITORY: ${{ secrets.REPO_OPS_MONO_REPOSITORY }}
run: |
set -euo pipefail
[[ "$MONO_REPOSITORY" =~ ^[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+$ ]]
[[ "$PUBLIC_SHA" =~ ^[0-9a-f]{40}$ ]]
gh api "repos/${MONO_REPOSITORY}/dispatches" \
--method POST \
--field event_type=repo-ops-public-push \
--field "client_payload[public_sha]=$PUBLIC_SHA"