Revert "ci: PR Checker增加合并检查,合并后不再检查commit message" (#7459)

Reverts MaaAssistantArknights/MaaAssistantArknights#7457
This commit is contained in:
status102
2023-12-02 21:47:49 +08:00
committed by GitHub
parent a903171be5
commit 2c0390ec4d

View File

@@ -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(", ")}`);
}