| 1 | # This workflow is triggered after a PR is merged or when the title of a PR is |
| 2 | # changed post merge |
| 3 | name: "Label for Release Notes" |
| 4 | |
| 5 | |
| 6 | on: # zizmor: ignore[dangerous-triggers] Runs after merge or title edits and only uses trusted base-branch action code to maintain release-note labels. |
| 7 | pull_request_target: |
| 8 | types: |
| 9 | - closed |
| 10 | - edited # interested in post merge title changes |
| 11 | |
| 12 | permissions: |
| 13 | contents: read |
| 14 | pull-requests: write |
| 15 | |
| 16 | jobs: |
| 17 | ################################################### |
| 18 | # Assign labels on merge to generate Release Notes |
| 19 | # https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#running-your-workflow-when-a-pull-request-merges |
| 20 | ################################################### |
| 21 | if_merged: |
| 22 | name: "PR was merged" |
| 23 | if: (github.event.pull_request.merged == true) && ( github.event.action == 'closed' || (github.event.action == 'edited' && github.event.changes.title != null) ) |
| 24 | uses: aristanetworks/avd/.github/workflows/release-note-labeler.yml@6a65932293a2b5ece0edb77712b475a505f1b878 # v6.3.0 |
| 25 | with: |
| 26 | auto_create_label: true |