Skip to content

deps(deps): bump actions/setup-node from 6.4.0 to 7.0.0 in the github-actions group #223

deps(deps): bump actions/setup-node from 6.4.0 to 7.0.0 in the github-actions group

deps(deps): bump actions/setup-node from 6.4.0 to 7.0.0 in the github-actions group #223

name: Validate PR description is not empty
on:
pull_request:
types: [ opened, edited, reopened, synchronize ]
permissions:
contents: read
jobs:
check-description:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
issues: write
steps:
- name: Check out the repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Check PR description
id: validate_description_step
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const pr = context.payload.pull_request;
if (!pr || !pr.body || pr.body.trim().length === 0) {
core.setOutput('pr_description_check_passed', 'false');
}
else {
core.setOutput('pr_description_check_passed', 'true');
}
- name: Find Comment
uses: peter-evans/find-comment@b30e6a3c0ed37e7c023ccd3f1db5c6c0b0c23aad # v4.0.0
id: fc
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'github-actions[bot]'
- name: Update comment with validation failed statement
if: ${{ steps.validate_description_step.outputs.pr_description_check_passed == 'false' }}
uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5.0.0
with:
issue-number: ${{ github.event.pull_request.number }}
comment-id: ${{ steps.fc.outputs.comment-id }}
edit-mode: replace
body: |
⚠️ **Пожалуйста, добавь описание к pull request.**
Описание pull request помогает лучше понять изменения, которые вы вносите, облегчает процесс ревью и поиска причин инцидентов.
Описание должно содержать **причину** изменений: какую **проблему** решаем, **зачем** делаем изменение, а не что изменилось.
Причина может быть в описании issue или в треде, тогда достаточно указать ссылку.
* Добавь ссылку на issue или тред, в котором раскрыта причина изменения
* Если требуется, коротко опиши зачем делаешь изменение, какую проблему решаешь
Спасибо!
- name: Fail the job if description is empty
if: ${{ steps.validate_description_step.outputs.pr_description_check_passed == 'false' }}
run: |
echo "⚠️ Ошибка: Пожалуйста, добавьте описание к pull request."
exit 1