mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Updated the instructions for adding changelog entries in the pull_request_changelog.yml workflow file. The changes provide more specific instructions on how to name and write the changelog entry file. This was done to provide clearer instructions to contributors updating the changelog.
99 lines
3.2 KiB
YAML
99 lines
3.2 KiB
YAML
name: "Check that changes are described"
|
|
on:
|
|
pull_request_target:
|
|
types:
|
|
- "opened"
|
|
- "reopened"
|
|
- "synchronize"
|
|
- "labeled"
|
|
- "unlabeled"
|
|
|
|
jobs:
|
|
changes-required:
|
|
runs-on: ubuntu-latest
|
|
if: "!contains(github.event.pull_request.labels.*.name, 'skip news')"
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@master
|
|
with:
|
|
ref: ${{ github.event.pull_request.head.sha }}
|
|
fetch-depth: '0'
|
|
|
|
- name: Set up Python 3.10
|
|
uses: actions/setup-python@v2
|
|
with:
|
|
python-version: "3.10"
|
|
|
|
- name: Install towncrier
|
|
run: pip install towncrier
|
|
|
|
- name: Check changelog
|
|
env:
|
|
BASE_BRANCH: ${{ github.base_ref }}
|
|
run: |
|
|
git fetch --no-tags origin +refs/heads/${BASE_BRANCH}:refs/remotes/origin/${BASE_BRANCH}
|
|
towncrier check --compare-with origin/${BASE_BRANCH}
|
|
|
|
- name: Find bot comment
|
|
if: "always()"
|
|
uses: peter-evans/find-comment@v2
|
|
id: fc
|
|
with:
|
|
issue-number: ${{ github.event.pull_request.number }}
|
|
comment-author: 'github-actions[bot]'
|
|
body-includes: Changelog
|
|
|
|
- name: Ask for changelog
|
|
if: "failure()"
|
|
uses: peter-evans/create-or-update-comment@v2
|
|
with:
|
|
edit-mode: replace
|
|
comment-id: ${{ steps.fc.outputs.comment-id }}
|
|
issue-number: ${{ github.event.pull_request.number }}
|
|
body: |
|
|
# :x: Changelog is required!
|
|
|
|
You need to add a brief description of the changes to the `CHANGES` directory.
|
|
|
|
Changes file should be named like `<issue or PR number>.<category>.rst`,
|
|
example `1234.bugfix.rst` where `1234` is the PR or issue number and `bugfix` is the category.
|
|
|
|
The content of the file should be a brief description of the changes in
|
|
the PR in the format of a description of what has been done.
|
|
|
|
Possible categories are: `feature`, `bugfix`, `doc`, `removal` and `misc`.
|
|
|
|
- name: Changelog found
|
|
if: "success()"
|
|
uses: peter-evans/create-or-update-comment@v2
|
|
with:
|
|
edit-mode: replace
|
|
comment-id: ${{ steps.fc.outputs.comment-id }}
|
|
issue-number: ${{ github.event.pull_request.number }}
|
|
body: |
|
|
# :heavy_check_mark: Changelog found.
|
|
|
|
Thank you for adding a description of the changes
|
|
|
|
skip-news:
|
|
runs-on: ubuntu-latest
|
|
if: "contains(github.event.pull_request.labels.*.name, 'skip news')"
|
|
steps:
|
|
- name: Find bot comment
|
|
uses: peter-evans/find-comment@v2
|
|
id: fc
|
|
with:
|
|
issue-number: ${{ github.event.pull_request.number }}
|
|
comment-author: 'github-actions[bot]'
|
|
body-includes: Changelog
|
|
|
|
- name: Comment when docs is not needed
|
|
uses: peter-evans/create-or-update-comment@v2
|
|
with:
|
|
edit-mode: replace
|
|
comment-id: ${{ steps.fc.outputs.comment-id }}
|
|
issue-number: ${{ github.event.pull_request.number }}
|
|
body: |
|
|
# :corn: Changelog is not needed.
|
|
|
|
This PR does not require a changelog because `skip news` label is present.
|