mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-18 10:10:45 +08:00
Revert "ci: PR Checker增加合并检查,合并后不再检查commit message" (#7459)
Reverts MaaAssistantArknights/MaaAssistantArknights#7457
This commit is contained in:
27
.github/workflows/pr-checker.yml
vendored
27
.github/workflows/pr-checker.yml
vendored
@@ -9,27 +9,8 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: 检查 PR 是否已合并
|
||||
id: pr_status
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
script: |
|
||||
const { data: pr } = await github.rest.pulls.get({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
pull_number: context.payload.pull_request.number
|
||||
});
|
||||
|
||||
if (pr.merged) {
|
||||
console.log("PR(${context.payload.inputs.pr_number}) 已合并");
|
||||
} else {
|
||||
console.log("PR(${context.payload.inputs.pr_number}) 未合并");
|
||||
}
|
||||
core.setOutput("pr_merged", pr.merged);
|
||||
|
||||
- name: Check Commit Message
|
||||
if: ${{ steps.pr_status.outputs.pr_merged == 'False' }}
|
||||
- name: Check Commits
|
||||
if: github.event_name == 'pull_request'
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -46,6 +27,6 @@ jobs:
|
||||
console.log(`check ${commits.length} commit(s)`);
|
||||
|
||||
if (invalidCommits.length > 0) {
|
||||
const invalidCommitMessages = invalidCommits.map(commit => commit.commit.message);
|
||||
core.setFailed(`Invalid commit message found: ${invalidCommitMessages.join(", ")}`);
|
||||
const invalidCommitNames = invalidCommits.map(commit => commit.commit.message);
|
||||
core.setFailed(`Invalid commit names found: ${invalidCommitNames.join(", ")}`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user