feat: enhance workflow to trigger on PR merge events

Co-authored-by: Stalin-143 <161853795+Stalin-143@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-01-22 04:25:46 +00:00
parent bad409ae3e
commit 9674a4b595
+12 -3
View File
@@ -1,16 +1,25 @@
name: Update Contributors name: Update Contributors Hall of Fame
on: on:
# Trigger when PRs are merged to main (push to main branch)
push: push:
branches: branches:
- main - main
# Trigger when pull requests are closed (merged)
pull_request:
types: [closed]
branches:
- main
# Run daily at midnight UTC to catch any missed updates
schedule: schedule:
# Run daily at midnight UTC
- cron: '0 0 * * *' - cron: '0 0 * * *'
# Allow manual trigger for on-demand updates
workflow_dispatch: workflow_dispatch:
jobs: jobs:
update-contributors: update-contributors:
# Only run if push to main, scheduled, manual trigger, or PR merged to main
if: github.event_name != 'pull_request' || github.event.pull_request.merged == true
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions: permissions:
contents: write contents: write
@@ -21,7 +30,7 @@ jobs:
with: with:
fetch-depth: 0 fetch-depth: 0
- name: Update Contributors - name: Update Contributors Hall of Fame
uses: akhilmhdh/contributors-readme-action@v2.3.6 uses: akhilmhdh/contributors-readme-action@v2.3.6
with: with:
readme_path: "CONTRIBUTORS.md" readme_path: "CONTRIBUTORS.md"