diff --git a/.github/workflows/cross-sync-devshelf.yml b/.github/workflows/cross-sync-devshelf.yml index a15f647..1e00306 100644 --- a/.github/workflows/cross-sync-devshelf.yml +++ b/.github/workflows/cross-sync-devshelf.yml @@ -12,6 +12,7 @@ jobs: runs-on: ubuntu-latest permissions: contents: write + pull-requests: write steps: - name: Checkout Repository uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 @@ -34,6 +35,8 @@ jobs: run: npm test - name: Commit and Push Updates + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | git config --global user.name "github-actions[bot]" git config --global user.email "github-actions[bot]@users.noreply.github.com" @@ -42,5 +45,10 @@ jobs: echo "No cross-sync changes needed." else git commit -m "chore(sync): automated cross-sync with DevShelf MCP catalog" - git push origin main + git push origin main || ( + BRANCH="sync/devshelf-$(date +%Y%m%d%H%M)" + git checkout -b "$BRANCH" + git push origin "$BRANCH" --force + gh pr create --title "chore(sync): automated cross-sync with DevShelf MCP catalog" --body "Automated catalog sync with DevShelf." --head "$BRANCH" --base main + ) fi