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

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. - uses: mdecoleman/pr-branch-name@bab4c71506bcd299fb350af63bb8e53f2940a599 # v2.0.0
  26. id: branchname
  27. with:
  28. repo-token: ${{ secrets.GITHUB_TOKEN }}
  29. # GitHub actions bot approve
  30. - uses: hmarr/auto-approve-action@b40d6c9ed2fa10c9a2749eca7eb004418a705501 # v2
  31. if: startsWith(steps.branchname.outputs.branch, 'automated/noid/') && endsWith(steps.branchname.outputs.branch, 'update-psalm-baseline')
  32. with:
  33. github-token: ${{ secrets.GITHUB_TOKEN }}
  34. # Enable GitHub auto merge
  35. - name: Auto merge
  36. uses: alexwilson/enable-github-automerge-action@56e3117d1ae1540309dc8f7a9f2825bc3c5f06ff # main
  37. if: startsWith(steps.branchname.outputs.branch, 'automated/noid/') && endsWith(steps.branchname.outputs.branch, 'update-psalm-baseline')
  38. with:
  39. github-token: ${{ secrets.GITHUB_TOKEN }}