Skip to content

Test: pr에 스토리북 넣기 테스트 #4

Test: pr에 스토리북 넣기 테스트

Test: pr에 스토리북 넣기 테스트 #4

name: link_pr_to_issue
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 = feat/(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 issueNumber= pr.data.head.ref.split('/')[1];
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
});
append_storybook_link_to_fe_pr_body:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Update FE PR body
run: |
if [ "${{ github.event.pull_request.labels }}" == *'FE'* ]; then
# If the 'FE' label is present on the PR, add the Storybook link to the PR body
STORYBOOK_LINK="<br/><br /> 🚀 **[Storybook](https://storybook.carffe.in/)**"
PR_BODY=$(jq -n --arg STORYBOOK_LINK "$STORYBOOK_LINK" '$STORYBOOK_LINK + "\n" + input')
echo "::set-output name=PR_BODY::$PR_BODY"
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}