Skip to content

_Update GitHub Contributors #6

_Update GitHub Contributors

_Update GitHub Contributors #6

name: Update GitHub Contributors at examples.json
on:
workflow_dispatch:
jobs:
github-contributors:
runs-on: ubuntu-latest
permissions:
contents: write # Needed to push changes
steps:
- uses: actions/checkout@v4
- name: Make script executable
run: chmod +x .github/workflows/scripts/fetch_contributors.sh
- name: Update contributors
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO_OWNER: ${{ github.repository_owner }}
REPO_NAME: ${{ github.event.repository.name }}
run: ./.github/workflows/scripts/fetch_contributors.sh
- name: Commit changes
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add _data/examples.json
git diff --quiet && git diff --staged --quiet || git commit -m "Update contributors"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}