Files
supabase/.github/workflows/docs-sync-auto-troubleshooting.yml
dependabot[bot] 450587d8b6 build(deps): bump actions/setup-node from 4.4.0 to 7.0.0
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 4.4.0 to 7.0.0.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/49933ea5288caeca8642d1e84afbd3f7d6820020...820762786026740c76f36085b0efc47a31fe5020)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-version: 6.4.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-07-28 00:07:54 +00:00

89 lines
3.3 KiB
YAML

# Sync AI-generated troubleshooting guides from supabase/troubleshooting
name: Sync from supabase/troubleshooting
on:
repository_dispatch:
types: [sync_from_upstream]
workflow_dispatch:
permissions:
contents: write
pull-requests: write
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout supabase/supabase
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: true
- name: Install pnpm
uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
with:
run_install: false
- name: Use Node.js
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version-file: '.nvmrc'
cache: 'pnpm'
- name: Install deps
run: pnpm install --frozen-lockfile
- name: Create GitHub App token for supabase/troubleshooting
id: app-token
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
with:
client-id: ${{ vars.DOCS_GITHUB_APP_CLIENT_ID }}
private-key: ${{ secrets.DOCS_GITHUB_APP_PRIVATE_KEY_V2 }}
repositories: troubleshooting
permission-contents: read
- name: Checkout supabase/troubleshooting
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
token: ${{ steps.app-token.outputs.token }}
repository: supabase/troubleshooting
path: troubleshooting-upstream
- name: Generate PR token
id: pr-token
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
with:
client-id: ${{ vars.GH_AUTOFIX_APP_CLIENT_ID }}
private-key: ${{ secrets.GH_AUTOFIX_PRIVATE_KEY }}
permission-pull-requests: write
- name: Sync supabase/troubleshooting changes back to supabase/supabase
env:
GH_TOKEN: ${{ steps.pr-token.outputs.token }}
run: |
git config user.name 'github-docs-bot'
git config user.email 'github-docs-bot@supabase.com'
BRANCH_NAME="bot/sync-troubleshooting"
EXISTING_BRANCH=$(git ls-remote --heads origin $BRANCH_NAME)
if [[ -n "$EXISTING_BRANCH" ]]; then
git push origin --delete $BRANCH_NAME
fi
git checkout -b $BRANCH_NAME
rsync --archive --verbose --ignore-existing ./troubleshooting-upstream/guides/ ./apps/docs/content/troubleshooting/
pnpm format
git add apps/docs/content/troubleshooting/
if git diff --quiet --cached; then
echo "No changes to sync"
exit 0
fi
git commit --message "Sync from supabase/troubleshooting"
git push origin $BRANCH_NAME
if gh pr list --state open --head $BRANCH_NAME --json number --jq '.[0].number' | grep -q .; then
gh pr comment "$BRANCH_NAME" --body "Updated troubleshooting sync with latest changes."
else
gh pr create --title "[bot] Sync from supabase/troubleshooting" --body "This PR syncs the latest troubleshooting guides from the supabase/troubleshooting repository." --head $BRANCH_NAME
fi