-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (40 loc) · 1.44 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: Actualizar lista de issues en README
on:
push:
branches: [ main ]
jobs:
actualizar_readme:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- name: Obtener Lista de issues abiertos
id: obtener_lista_issues
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const { data: issues } = await github.rest.issues.listForRepo({
owner: context.repo.owner,
repo: context.repo.repo,
per_page: 100,
state: 'open'
});
const issueList = issues.map(issue => `* [${issue.title}](${issue.html_url})`).join('\n');
return issueList;
- name: Actualizar Readme
run: |
issue_list="${{ steps.obtener_lista_issues.outputs.result }}"
# Usamos sed para reemplazar la sección de Issues Abiertas en el README.md
sed -i '/## Issues Abiertas/,$d' README.md
echo -e "## Issues Abiertas\n\n$issue_list\n" >> README.md
- name: Commit and Push changes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --global user.name 'github-actions'
git config --global user.email 'github-actions@github.com'
git add README.md
git commit -m 'Actualizar lista de issues en README'
git push