Skip to content

Commit

Permalink
Making the Contributor Map workflow create a branch and a PR and runn…
Browse files Browse the repository at this point in the history
…ing it only once a month
  • Loading branch information
Piedone committed Feb 16, 2024
1 parent fe31229 commit 5d214cc
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions .github/workflows/contributor_map.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,37 @@ name: Contributor Map
on:
workflow_dispatch:
schedule:
# At 3:00 AM UTC every Monday.
- cron: "0 3 * * 1"
# At 3:00 AM UTC the first day of every month.
- cron: "0 3 1 * *"

jobs:
update-contributor-map:
name: Update Contributor Map
runs-on: ubuntu-latest

steps:
- name: Create Branch
id: create-branch
run: |
$date = Get-Date -Format "yyyy-MM-dd"
$branchName = "contributor-map/$date-update"
git checkout -b $branchName
git push origin $branchName
"date=$date" >> $Env:GITHUB_OUTPUT
"branch-name=$branchName" >> $Env:GITHUB_OUTPUT
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Update Contributor Map
uses: tunaitis/contributor-map@da8a84b848781bccaa56bc73519c055f4814e512 #v1
with:
output: src/docs/community/contributors/images/contributors-map.svg

- name: Create Pull Request
uses: peter-evans/create-pull-request@b1ddad2c994a25fbc81a28b3ec0e368bb2021c50 #v6.0.0
with:
branch: ${{ steps.create-branch.outputs.branch-name }}
base: ${{ github.event.repository.default_branch}}
title: Contributor Map Update for ${{ steps.create-branch.outputs.date }}

0 comments on commit 5d214cc

Please sign in to comment.