Skip to content

Commit

Permalink
chore: set bot as commit author & set most active contributor as revi…
Browse files Browse the repository at this point in the history
…ewer
  • Loading branch information
diogogmatos committed Oct 8, 2024
1 parent cfff8e2 commit 84283e7
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
schedule:
# run every 7 days
- cron: "0 0 * * 0"
workflow_dispatch: # enables manual triggering
workflow_dispatch: # enables manual triggering

jobs:
build:
Expand Down Expand Up @@ -43,6 +43,21 @@ jobs:
npm ci
npm run format
- name: Configure Git
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Get Most Active Contributors
id: get_contributors
run: |
# Fetch contributors using GitHub API
contributors=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
"https://api.github.com/repos/${{ github.repository }}/contributors?per_page=5")
# Extract the login names of the top contributors
echo "::set-output name=reviewers::$(echo $contributors | jq -r '.[].login' | tr '\n' ',')"
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
Expand All @@ -57,5 +72,5 @@ jobs:
base: master
delete-branch: true
labels: add activities, automated
reviewers: diogogmatos
reviewers: ${{ steps.get_contributors.outputs.reviewers }}
token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 84283e7

Please sign in to comment.