-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
3 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,18 @@ | ||
name: Contributor Map | ||
|
||
on: | ||
# Running this automatically would require jumping through a lot of hoops because tunaitis/contributor-map commits to | ||
# the branch where the workflow was triggered, i.e. `main` for the schedule trigger. So, better to occasionally run | ||
# it manually in a PR. | ||
workflow_dispatch: | ||
schedule: | ||
# 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: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Create Branch | ||
id: create-branch | ||
shell: pwsh | ||
run: | | ||
$date = Get-Date -Format "yyyy-MM-dd" | ||
$branchName = "contributor-map/$date-update" | ||
# Without this, the branch will be created from the default branch (main) instead of the current one. | ||
git checkout -b ${{ github.ref_name}} | ||
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 }} |