Skip to content

Commit eef5542

Browse files
CI/CD para verificar o fechamento de issues.
1 parent 59d491b commit eef5542

1 file changed

Lines changed: 56 additions & 0 deletions

File tree

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: check-issue-linked
2+
on:
3+
pull_request:
4+
types: [opened, reopened, synchronize]
5+
issues:
6+
types: [opened, reopened]
7+
8+
jobs:
9+
check-issue-linked:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Check if issue is linked to PR
13+
if: github.event_name == 'pull_request' && !contains(github.event.pull_request.body, 'close') && !contains(github.event.pull_request.body, 'fix')
14+
uses: peter-evans/create-or-update-comment@v4
15+
with:
16+
issue-number: ${{ github.event.pull_request.number }}
17+
body: |
18+
🇧🇷🇧🇷🇧🇷
19+
**A descrição do seu PR não menciona o fechamento da issue relacionada.** Para fechar a issue automaticamente quando este PR for mergeado, você pode adicionar um termo como `Fixes #<número-da-issue>` ou `Closes #<número-da-issue>` na descrição.
20+
21+
Isso ajuda a manter o repositório mais organizado e garante que a issue seja fechada automaticamente assim que o código for integrado. Para saber mais sobre como isso funciona, você pode consultar a [documentação oficial do GitHub sobre fechamento automático de issues](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue-using-a-keyword).
22+
23+
Então basta editar a descrição do seu PR clicando em edit
24+
25+
![image](https://github.com/user-attachments/assets/19f4ab6e-e4c5-4ac5-8139-02dafedeb044)
26+
27+
Adicionando a linha:
28+
29+
> Closes #número_da_issue
30+
31+
E finalmente, clicando em update comment:
32+
33+
<img width="149" alt="image" src="https://github.com/user-attachments/assets/234b5981-5031-4f49-a387-bb0b8fe8c359" />
34+
35+
Se precisar de ajuda para fazer isso ou tiver dúvidas, é só avisar! 😊
36+
37+
---
38+
🇬🇧 🇬🇧 🇬🇧
39+
40+
**The description of your PR does not mention closing the related issue.** To close the issue automatically when this PR is merged, you can add a keyword like `Fixes #<issue-number>` or `Closes #<issue-number>` in the description.
41+
42+
This helps keep the repository more organized and ensures that the issue is automatically closed as soon as the code is merged. To learn more about how this works, you can check out the [official GitHub documentation on automatic issue closing](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue-using-a-keyword).
43+
44+
Then simply edit your PR description by clicking on "Edit."
45+
46+
![image](https://github.com/user-attachments/assets/19f4ab6e-e4c5-4ac5-8139-02dafedeb044)
47+
48+
Add the line:
49+
50+
> Closes #issue_number
51+
52+
And finally, click "Update Comment":
53+
54+
<img width="149" alt="image" src="https://github.com/user-attachments/assets/234b5981-5031-4f49-a387-bb0b8fe8c359" />
55+
56+
If you need help with this or have any questions, feel free to reach out! 😊

0 commit comments

Comments
 (0)