-
Notifications
You must be signed in to change notification settings - Fork 48
ci(workflows): 同步 dev 分支工作流 #637
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| # AUTO-MAS: A Multi-Script, Multi-Config Management and Automation Software | ||
| # Copyright © 2025-2026 AUTO-MAS Team | ||
|
|
||
| # This file is part of AUTO-MAS. | ||
|
|
||
| # AUTO-MAS is free software: you can redistribute it and/or modify | ||
| # it under the terms of the GNU Affero General Public License as | ||
| # published by the Free Software Foundation, either version 3 of | ||
| # the License, or (at your option) any later version. | ||
|
|
||
| # AUTO-MAS is distributed in the hope that it will be useful, | ||
| # but WITHOUT ANY WARRANTY; without even the implied warranty | ||
| # of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See | ||
| # the GNU Affero General Public License for more details. | ||
|
|
||
| # You should have received a copy of the GNU Affero General Public License | ||
| # along with AUTO-MAS. If not, see <https://www.gnu.org/licenses/>. | ||
|
|
||
| # Contact: DLmaster_361@163.com | ||
|
|
||
| name: 检查更新日志 | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [opened, synchronize, reopened, ready_for_review] | ||
|
|
||
| permissions: | ||
| contents: read | ||
| pull-requests: read | ||
|
|
||
| jobs: | ||
| check-changelog: | ||
| name: 检查 CHANGELOG.md 与生成物一致 | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: 检出代码 | ||
| uses: actions/checkout@v7.0.1 | ||
|
|
||
| - name: 设置 Python 环境 | ||
| uses: actions/setup-python@v7.0.0 | ||
| with: | ||
| python-version: '3.12' | ||
|
|
||
| # CHANGELOG.md 是唯一手写来源,res/version.json 与四处版本号都由它生成。 | ||
| # 这一步同时校验更新日志格式、五处版本号一致、生成物是最新的。 | ||
| - name: 检查更新日志格式与版本号一致性 | ||
| run: python scripts/changelog.py check | ||
|
sourcery-ai[bot] marked this conversation as resolved.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
For every opened or synchronized PR, this step checks out the reviewed tree and immediately runs a file that is not present: a repo-wide search of this commit finds neither Useful? React with 👍 / 👎. |
||
|
|
||
| - name: 检查 PR 文件列表 | ||
| uses: actions/github-script@v9.0.0 | ||
| with: | ||
| script: | | ||
| const files = await github.paginate(github.rest.pulls.listFiles, { | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| pull_number: context.issue.number, | ||
| per_page: 100, | ||
| }); | ||
|
|
||
| if (!files.some(file => file.filename === 'CHANGELOG.md')) { | ||
| core.setFailed('每个 PR 都必须包含对 CHANGELOG.md 的更改。'); | ||
|
Comment on lines
+61
to
+62
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Once the missing tooling is supplied, this check makes Useful? React with 👍 / 👎. |
||
| } | ||
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When a merged PR's base commit has no
CHANGELOG.mdor its file cannot be parsed—as will happen for the first migration PR based on this commit, whose tree has no such file—returning{}does not skip the comparison. It makes every entry in the PR head appear newly added, so the later loop appends that PR author's suffix to every matching unsuffixed historical entry in the current changelog, corrupting contributor attribution; this path should terminate without making attribution changes instead.Useful? React with 👍 / 👎.