Skip to content

Commit

Permalink
docs: contribuidores adicionados no readme.md
Browse files Browse the repository at this point in the history
  • Loading branch information
devluizmarcolino committed Feb 5, 2025
1 parent fc098f4 commit 31bfb12
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 0 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/contributors.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Contributors

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
contributors:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Generate contributors list
uses: actions/github-script@v6
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const contributors = await github.rest.repos.listContributors({
owner: context.repo.owner,
repo: context.repo.repo
});
const contributorsList = contributors.data
.filter(contributor => contributor.contributions > 0)
.map(contributor => `
<a href="https://github.com/${contributor.login}" target="_blank">
<img src="https://github.com/${contributor.login}.png" width="100" height="100" alt="${contributor.login}">
</a>`).join('\n');

const fs = require('fs');
const readmePath = './README.md';
let readmeContent = fs.readFileSync(readmePath, 'utf8');

const contributorsSection = `
## 👥 Contribuidores

Um agradecimento especial a todos que contribuíram para este projeto:

<div style="display: flex; flex-wrap: wrap; gap: 10px;">
${contributorsList}
</div>
`;
readmeContent = readmeContent.replace(/## 👥 Contribuidores[\s\S]*?(?=## 📘 Licença)/, contributorsSection);
fs.writeFileSync(readmePath, readmeContent);
- name: Commit changes
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add README.md
git commit -m "Update contributors list" || exit 0
git push
11 changes: 11 additions & 0 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,17 @@ Toda ajuda é bem-vinda! Para colaborar, siga esses passos:

Dê uma olhada no arquivo [CONTRIBUTING.md](./CONTRIBUTING.md) para mais detalhes.


---

## 👥 Contribuidores

Um agradecimento especial a todos que contribuíram para este projeto:

<div style="display: flex; flex-wrap: wrap; gap: 10px;">

</div>

---


Expand Down

0 comments on commit 31bfb12

Please sign in to comment.