test auto action

pull/1680/head
FonduemangVI 9 months ago
parent 7464dfd3e0
commit d1085ace4e

@ -0,0 +1,15 @@
const fs = require('fs');
const axios = require('axios');
const owner = 'FonduemangVI';
const repo = 'Guides';
axios.get(`https://api.github.com/repos/${owner}/${repo}/contributors`)
.then(response => {
const contributors = response.data.map(user => `- [@${user.login}](${user.html_url})`).join('\n');
fs.writeFileSync('CONTRIBUTORS.md', `# Contributors\n\n${contributors}\n`);
})
.catch(error => {
console.error(error);
process.exit(1);
});

@ -0,0 +1,25 @@
name: Update contributors
on:
push:
branches:
- main # or the default branch of your repository
jobs:
update_contributors:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install Node.js
uses: actions/setup-node@v2
with:
node-version: "14"
- name: Install dependencies
run: npm install axios
- name: Update CONTRIBUTORS.md
run: |
node .github/scripts/update-contributors.js
Loading…
Cancel
Save