fix: sdk-paths #10
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: PR Rebase Reminder | |
| on: | |
| pull_request: | |
| types: [opened, synchronize] | |
| jobs: | |
| check-rebase-needed: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout PR | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Check if rebase is needed | |
| id: rebase_check | |
| run: | | |
| git fetch origin main | |
| BEHIND_COUNT=$(git rev-list --count HEAD..origin/main) | |
| echo "behind_count=$BEHIND_COUNT" >> $GITHUB_OUTPUT | |
| - name: Comment on PR if rebase needed | |
| if: steps.rebase_check.outputs.behind_count > 0 | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const behindCount = '${{ steps.rebase_check.outputs.behind_count }}'; | |
| if (behindCount > 0) { | |
| const body = `## 🔄 Rebase Required | |
| This branch is ${behindCount} commit(s) behind the main branch. Please rebase your branch to ensure a clean merge: | |
| \`\`\`bash | |
| git fetch origin main | |
| git rebase origin/main | |
| git push --force-with-lease | |
| \`\`\` | |
| This is required by our branch protection rules to maintain a linear git history.`; | |
| github.rest.issues.createComment({ | |
| issue_number: context.issue.number, | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| body: body | |
| }); | |
| } |