Skip to content
name: "Notify about updates to Kuma (updated)"
on:
push:
tags:
- '*'
branches:
- lobkovilya-test-workflow
permissions:
contents: read
jobs:
notify-about-merged-pr:
timeout-minutes: 10
name: "Notify about merged PR"
runs-on: ubuntu-24.04
steps:
- name: Logging
run: |
echo "${{toJSON(github.event)}}"
- name: "Send repository dispatch event"
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
github-token: ${{ secrets.NOTIFY_BOT_PAT_TOKEN }}
script: |
let branch, pr;
if (github.ref_type === "tag") {
const versionRegex = /v?(\d+)\.(\d+)\.\d+/;
const versionMatch = github.ref_name.match(versionRegex);
if (!versionMatch) {
return;
}
const [_, major, minor] = [...versionMatch];
branch = `release-${major}.${minor}`;
} else if (github.ref_type === "branch") {
branch = github.ref_name;
const commit = await github.rest.repos.getCommit({
owner: context.repo.owner,
repo: context.repo.repo,
ref: github.sha
});
pr = commit.data.commit.message;
}
# return github.rest.repos.createDispatchEvent({
# owner: '${{ secrets.NOTIFY_OWNER }}',
# repo: '${{ secrets.NOTIFY_REPO }}',
# event_type: '${{ secrets.NOTIFY_EVENT_TYPE }}',
# client_payload: {
# branch,
# pr,
# },
# });
console.log('Branch:', branch);
console.log('PR:', pr);