Skip to content

Commit

Permalink
Keeping the manual trigger for now
Browse files Browse the repository at this point in the history
  • Loading branch information
Piedone committed Feb 16, 2024
1 parent 1b7738c commit bd34b6c
Showing 1 changed file with 3 additions and 30 deletions.
33 changes: 3 additions & 30 deletions .github/workflows/contributor_map.yml
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 }}

0 comments on commit bd34b6c

Please sign in to comment.