diff --git a/.github/credits.md b/.github/credits.md new file mode 100644 index 0000000000..173c05d0dd --- /dev/null +++ b/.github/credits.md @@ -0,0 +1,27 @@ +### Timestamp: +2023-11-20T17:17:05Z +### Contributor: +qcdyx +#### PR Number: +1602 +#### PR Title: +feat: Added workflow for better Recognize/Credit Contributors +########################################################################################x +### Timestamp: +2023-11-20T20:09:14Z +### Contributor: +qcdyx +#### PR Number: +1602 +#### PR Title: +feat: Added workflow for better Recognize/Credit Contributors +########################################################################################x +### Timestamp: +2024-09-16T20:29:34Z +### Contributor: +qcdyx +#### PR Number: +1602 +#### PR Title: +feat: Added workflow for better Recognize/Credit Contributors +########################################################################################x diff --git a/.github/workflows/update_credits.yml b/.github/workflows/update_credits.yml new file mode 100644 index 0000000000..0ec31044a9 --- /dev/null +++ b/.github/workflows/update_credits.yml @@ -0,0 +1,35 @@ +name: Update Credits upon creating PR + +on: + pull_request: + branches: + - master + types: + - opened + - synchronize + +jobs: + update-credits: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.ref }} + - run: | + echo "### Timestamp:" >> .github/credits.md + echo "$(date -u +"%Y-%m-%dT%H:%M:%SZ")" >> .github/credits.md + echo "### Contributor:" >> .github/credits.md + echo "${{ github.event.pull_request.user.login }}" >> .github/credits.md + echo "#### PR Number:" >> .github/credits.md + echo "${{ github.event.pull_request.number }}" >> .github/credits.md + echo "#### PR Title:" >> .github/credits.md + echo "${{ github.event.pull_request.title }}" >> .github/credits.md + echo "########################################################################################x" >> .github/credits.md + + git add .github/credits.md + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + git commit -m "Update credits.md with contributor information" + git push origin ${{ github.event.pull_request.head.ref}} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}