ci: pr checker

This commit is contained in:
status102
2024-03-14 16:00:04 +08:00
parent 4696efcdc1
commit 3fb40e90a7

View File

@@ -1,12 +1,9 @@
name: PR Checker
on:
pull_request:
pull_request_target:
types: [opened, edited, ready_for_review, reopened, synchronize]
permissions:
issues: write
pull-requests: write
jobs:
check_commit_name_in_pr:
@@ -16,7 +13,6 @@ jobs:
- name: Cleanup Previous Comment
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const { data: comments } = await github.rest.issues.listComments({
owner: context.repo.owner,
@@ -32,11 +28,9 @@ jobs:
comment_id: previousComment.id
});
}
- name: Check Commits
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const { data: commits } = await github.rest.pulls.listCommits({
owner: context.repo.owner,
@@ -62,4 +56,4 @@ jobs:
});
core.setFailed(`Found ${invalidCommits.length} invalid commit(s):\n${invalidCommitNames.join("\n-------------------\n")}`);
}
}