mirror of
https://github.com/bluewave-labs/Checkmate.git
synced 2026-05-04 07:29:40 -05:00
use github cli
This commit is contained in:
@@ -40,17 +40,20 @@ jobs:
|
||||
working-directory: server
|
||||
run: npm run format-check
|
||||
close-pr-if-needed:
|
||||
if: always()
|
||||
runs-on: ubuntu-latest
|
||||
needs: [format-client, format-server]
|
||||
if: |
|
||||
always() && (
|
||||
needs.format-client.result == 'failure' ||
|
||||
needs.format-server.result == 'failure'
|
||||
)
|
||||
steps:
|
||||
- name: Close PR
|
||||
uses: peter-evans/close-pull@v3
|
||||
with:
|
||||
comment: |
|
||||
❌ Formatting check failed — PR auto-closed.
|
||||
Please run `npm run format` and push again.
|
||||
- name: Get PR URL
|
||||
id: pr
|
||||
run: echo "PR_URL=$(jq -r .pull_request.url "$GITHUB_EVENT_PATH")" >> $GITHUB_ENV
|
||||
|
||||
- name: Close PR using GitHub CLI
|
||||
if: |
|
||||
needs.format-client.result == 'failure' ||
|
||||
needs.format-server.result == 'failure'
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
gh pr close "$PR_URL" --delete-branch --comment "❌ Formatting check failed — PR auto-closed.
|
||||
Please run \`npm run format\` and push again."
|
||||
|
||||
Reference in New Issue
Block a user