1
0

update-psalm-baseline-approve-merge.yml 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. # SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
  2. # SPDX-License-Identifier: MIT
  3. name: Auto approve psalm baseline update
  4. on:
  5. pull_request_target:
  6. branches:
  7. - main
  8. - master
  9. - stable*
  10. permissions:
  11. contents: read
  12. concurrency:
  13. group: update-psalm-baseline-approve-merge-${{ github.head_ref || github.run_id }}
  14. cancel-in-progress: true
  15. jobs:
  16. auto-approve-merge:
  17. if: github.actor == 'nextcloud-command'
  18. runs-on: ubuntu-latest-low
  19. permissions:
  20. # for hmarr/auto-approve-action to approve PRs
  21. pull-requests: write
  22. # for alexwilson/enable-github-automerge-action to approve PRs
  23. contents: write
  24. steps:
  25. - name: Disabled on forks
  26. if: ${{ github.event.pull_request.head.repo.full_name != github.repository }}
  27. run: |
  28. echo 'Can not approve PRs from forks'
  29. exit 1
  30. - uses: mdecoleman/pr-branch-name@55795d86b4566d300d237883103f052125cc7508 # v3.0.0
  31. id: branchname
  32. with:
  33. repo-token: ${{ secrets.GITHUB_TOKEN }}
  34. # GitHub actions bot approve
  35. - uses: hmarr/auto-approve-action@b40d6c9ed2fa10c9a2749eca7eb004418a705501 # v2
  36. if: startsWith(steps.branchname.outputs.branch, 'automated/noid/') && endsWith(steps.branchname.outputs.branch, 'update-psalm-baseline')
  37. with:
  38. github-token: ${{ secrets.GITHUB_TOKEN }}
  39. # Enable GitHub auto merge
  40. - name: Auto merge
  41. uses: alexwilson/enable-github-automerge-action@56e3117d1ae1540309dc8f7a9f2825bc3c5f06ff # main
  42. if: startsWith(steps.branchname.outputs.branch, 'automated/noid/') && endsWith(steps.branchname.outputs.branch, 'update-psalm-baseline')
  43. with:
  44. github-token: ${{ secrets.GITHUB_TOKEN }}