Skip to content

UI 수정 및 핀 추가 API 연동 #32

UI 수정 및 핀 추가 API 연동

UI 수정 및 핀 추가 API 연동 #32

name: assign_issue_number_to_pr_body
on:
pull_request:
types: [ opened ]
branches-ignore:
- main
jobs:
append_issue_number_to_pr_body:
runs-on: ubuntu-latest
steps:
- name: append feature number to pr body pr branch = feature/#(issueNumber)
uses: actions/github-script@v4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const pr = await github.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number
});
const body = pr.data.body;
const branchName = pr.data.head.ref;
const issueNumber = branchName.split('/').pop().replace('#', '');
const newBody = body + "\n\n" + "close #" + issueNumber;
await github.pulls.update({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number,
body: newBody
});