get-maintainers.yml 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. name: get-maintainers
  2. on:
  3. pull_request:
  4. types: [opened, reopened]
  5. permissions:
  6. pull-requests: write
  7. jobs:
  8. get_maintainers:
  9. runs-on: ubuntu-22.04
  10. steps:
  11. - uses: actions/checkout@v3
  12. with:
  13. fetch-depth: 10
  14. - name: Get commit branch and commit message from PR
  15. run: |
  16. echo "BRANCH_NAME=$GITHUB_HEAD_REF" >> $GITHUB_ENV
  17. echo "TARGET_BRANCH_NAME=$(echo ${GITHUB_BASE_REF##*/})" >> $GITHUB_ENV
  18. echo "COMMIT_MESSAGE<<EOF" >> $GITHUB_ENV
  19. echo "$(git log --format=%B -n 1 HEAD^2)" >> $GITHUB_ENV
  20. echo "EOF" >> $GITHUB_ENV
  21. echo "PREVIOUS_COMMIT=$(git log --format=%H -n 1 HEAD^2~1)" >> $GITHUB_ENV
  22. - uses: actions/setup-python@v4
  23. with:
  24. python-version: '3.10'
  25. architecture: 'x64'
  26. - name: Save PR number
  27. run: |
  28. mkdir -p ./maintainers
  29. echo ${{ github.event.number }} > ./maintainers/NR
  30. - name: Get Maintainers
  31. run: |
  32. python ./toolset/github_actions/get_maintainers.py > ./maintainers/maintainers.md
  33. - name: Save Maintainers
  34. uses: actions/upload-artifact@v3
  35. with:
  36. name: maintainers
  37. path: maintainers/