update-credits.yml 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. name: Update Contrib and Patreons in credits
  2. on:
  3. workflow_dispatch:
  4. schedule:
  5. - cron: 0 0 * * 0
  6. jobs:
  7. get_credits:
  8. runs-on: ubuntu-latest
  9. # Hey there fork dev! If you like to include your own contributors in this then you can probably just change this to your own repo
  10. # Do this in dump_github_contributors.ps1 too into your own repo
  11. if: github.repository == 'space-wizards/space-station-14'
  12. steps:
  13. - uses: actions/checkout@v3.6.0
  14. with:
  15. ref: master
  16. - name: Get this week's Contributors
  17. shell: pwsh
  18. env:
  19. GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
  20. run: Tools/dump_github_contributors.ps1 > Resources/Credits/GitHub.txt
  21. # TODO
  22. #- name: Get this week's Patreons
  23. # run: Tools/script2dumppatreons > Resources/Credits/Patrons.yml
  24. # MAKE SURE YOU ENABLED "Allow GitHub Actions to create and approve pull requests" IN YOUR ACTIONS, OTHERWISE IT WILL MOST LIKELY FAIL
  25. # For this you can use a pat token of an account with direct push access to the repo if you have protected branches.
  26. # Uncomment this and comment the other line if you do this.
  27. # https://github.com/stefanzweifel/git-auto-commit-action#push-to-protected-branches
  28. #- name: Commit new credit files
  29. # uses: stefanzweifel/git-auto-commit-action@v4
  30. # with:
  31. # commit_message: Update Credits
  32. # commit_author: PJBot <pieterjan.briers+bot@gmail.com>
  33. # This will make a PR
  34. - name: Set current date as env variable
  35. run: echo "NOW=$(date +'%Y-%m-%dT%H-%M-%S')" >> $GITHUB_ENV
  36. - name: Create Pull Request
  37. uses: peter-evans/create-pull-request@v5
  38. with:
  39. commit-message: Update Credits
  40. title: Update Credits
  41. body: This is an automated Pull Request. This PR updates the github contributors in the credits section.
  42. author: PJBot <pieterjan.briers+bot@gmail.com>
  43. branch: automated/credits-${{env.NOW}}