From 3b645690d844625bf0b0390db0909407853f5a3d Mon Sep 17 00:00:00 2001 From: D-K-P <8297864+D-K-P@users.noreply.github.com> Date: Thu, 11 Jun 2026 17:23:25 +0100 Subject: [PATCH] chore: add workflow to sync skills from trigger.dev monorepo Weekly cron + manual dispatch. Clones triggerdotdev/trigger.dev with sparse-checkout, copies skills listed in sync-map.json under their public slugs, and opens or updates a PR. Uses the default GITHUB_TOKEN; no PAT required. --- .github/workflows/sync-from-monorepo.yml | 67 ++++++++++++++++++++++++ sync-map.json | 5 ++ 2 files changed, 72 insertions(+) create mode 100644 .github/workflows/sync-from-monorepo.yml create mode 100644 sync-map.json diff --git a/.github/workflows/sync-from-monorepo.yml b/.github/workflows/sync-from-monorepo.yml new file mode 100644 index 0000000..e7c3106 --- /dev/null +++ b/.github/workflows/sync-from-monorepo.yml @@ -0,0 +1,67 @@ +name: Sync skills from monorepo + +on: + schedule: + - cron: "0 6 * * 1" + workflow_dispatch: + +permissions: + contents: write + pull-requests: write + +jobs: + sync: + runs-on: ubuntu-latest + if: github.repository == 'triggerdotdev/skills' + steps: + - uses: actions/checkout@v4 + + - name: Fetch monorepo skills + run: | + git clone --depth 1 --filter=blob:none --no-checkout \ + https://github.com/triggerdotdev/trigger.dev.git monorepo + git -C monorepo sparse-checkout set --no-cone packages/cli-v3/skills + git -C monorepo checkout + echo "MONOREPO_SHA=$(git -C monorepo rev-parse HEAD)" >> "$GITHUB_ENV" + + - name: Apply sync map + run: | + set -euo pipefail + SRC=monorepo/packages/cli-v3/skills + jq -r 'to_entries[] | "\(.key)\t\(.value)"' sync-map.json | + while IFS=$'\t' read -r src dst; do + [ -d "$SRC/$src" ] || { echo "::warning::mapped skill '$src' not found in monorepo"; continue; } + rm -rf "./$dst" + cp -R "$SRC/$src" "./$dst" + done + comm -23 \ + <(find "$SRC" -mindepth 1 -maxdepth 1 -type d -printf '%f\n' | sort) \ + <(jq -r 'keys[]' sync-map.json | sort) \ + | sed 's/^/::warning::unmapped monorepo skill: /' + rm -rf monorepo + + - name: Open or update pull request + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + set -euo pipefail + if [ -z "$(git status --porcelain)" ]; then + echo "No changes to sync." + exit 0 + fi + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git checkout -B sync/monorepo-skills + git add -A + git commit -m "chore: sync skills from triggerdotdev/trigger.dev@${MONOREPO_SHA:0:7}" + git push --force-with-lease origin sync/monorepo-skills + body="Automated weekly sync from [\`triggerdotdev/trigger.dev@${MONOREPO_SHA:0:7}\`](https://github.com/triggerdotdev/trigger.dev/commit/${MONOREPO_SHA}). + + Mappings live in \`sync-map.json\`. To publish a new monorepo skill, add an entry there. See the workflow run for any unmapped skills." + existing=$(gh pr list --head sync/monorepo-skills --state open --json number --jq '.[0].number // empty') + if [ -n "$existing" ]; then + gh pr edit "$existing" --body "$body" + else + gh pr create --head sync/monorepo-skills --base main \ + --title "chore: sync skills from monorepo" --body "$body" + fi diff --git a/sync-map.json b/sync-map.json new file mode 100644 index 0000000..0ff2c16 --- /dev/null +++ b/sync-map.json @@ -0,0 +1,5 @@ +{ + "getting-started": "trigger-setup", + "authoring-tasks": "trigger-tasks", + "realtime-and-frontend": "trigger-realtime" +}