chore: upgrades deps and tools #1447
Workflow file for this run
This file contains 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: "Validate PR target" | |
on: | |
pull_request: | |
types: | |
- opened | |
- edited | |
- synchronize | |
permissions: | |
pull-requests: write | |
jobs: | |
main: | |
name: Validate PR target branch | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check PR target | |
id: check-pr-target | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
const isFeature = context.payload.pull_request.title.startsWith('feat'); | |
const targetsMain = context.payload.pull_request.base.ref == 'main'; | |
core.setOutput('needs-rebase', isFeature && targetsMain ? 'true' : 'false'); | |
- name: Comment PR | |
if: steps.check-pr-target.outputs.needs-rebase == 'true' | |
uses: thollander/actions-comment-pull-request@v2 | |
with: | |
message: "It looks like you are adding a new feature! :rocket: Please rebase and point your PR to the `develop` branch." | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
comment_tag: check_pr_target | |
mode: recreate | |
- name: Fail if feature PR is targeted to main | |
if: steps.check-pr-target.outputs.needs-rebase == 'true' | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
core.setFailed('Cannot merge feature type PR into main. Merge into a feature branch or develop') |