certbot/.github/workflows/merged.yaml
Brad Warren e9050f1a3c
dynamically determine base branch name in mattermost notifications (#10496)
previously, if we merged a PR into one of our point release branches,
the mattermost notification would still say it was merged into main.
this PR fixes that

you can see me testing this change on my fork with this [workflow
file](https://github.com/bmw/letsencrypt/actions/runs/19588662936/workflow#L30)
and this
[output](https://github.com/bmw/letsencrypt/actions/runs/19588662936/job/56102625766#step:2:4)

if this PR is merged, i'll do the same thing in our josepy repo
2025-11-24 13:42:14 -08:00

30 lines
1.3 KiB
YAML

name: Merge Event
on:
pull_request_target:
types:
- closed
permissions: {} # let's not use any permissions we don't need here
jobs:
if_merged:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
# github actions workflows triggered by pull_request_target can be
# dangerous because they run with additional privileges in an environment
# containing values that can be controlled by an attacker. because of
# this, please take extra caution when modifying the steps taken by this
# workflow. for additional information, see
# https://github.com/certbot/certbot/pull/10490
#
# we pin this action to a version tested and audited by certbot's
# maintainers for extra security. the full hash is used as doing so is
# recommended by zizmor
- uses: mattermost/action-mattermost-notify@b7d118e440bf2749cd18a4a8c88e7092e696257a
with:
MATTERMOST_WEBHOOK_URL: ${{ secrets.MATTERMOST_MERGE_WEBHOOK }}
TEXT: >
[${{ github.repository }}] |
[${{ github.event.pull_request.title }}
#${{ github.event.number }}](https://github.com/${{ github.repository }}/pull/${{ github.event.number }})
was merged into ${{ github.event.pull_request.base.ref }} by ${{ github.actor }}