Skip to content

docs: contribuidores adicionados no readme.md #1

docs: contribuidores adicionados no readme.md

docs: contribuidores adicionados no readme.md #1

Workflow file for this run

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">

Check failure on line 32 in .github/workflows/contributors.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/contributors.yml

Invalid workflow file

You have an error in your yaml syntax on line 32
<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