Skip to content

Perform list update upon deletion on FE only #37

Perform list update upon deletion on FE only

Perform list update upon deletion on FE only #37

name: Update PR Description
on:
pull_request:
types: [opened]
jobs:
update-description:
runs-on: ubuntu-latest
steps:
- name: Update PR Description
uses: actions/github-script@v6
with:
script: |
if (context.payload.pull_request.body.includes('<BASE_BRANCH>')) {
const baseBranch = context.payload.pull_request.base.ref;
const targetBranch = context.payload.pull_request.head.ref;
const updatedBody = context.payload.pull_request.body
.replace('<BASE_BRANCH>', baseBranch)
.replace('<TARGET_BRANCH>', targetBranch);
github.rest.pulls.update({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.payload.pull_request.number,
body: updatedBody,
});
}