Skip to content

Commit

Permalink
chore: add log
Browse files Browse the repository at this point in the history
  • Loading branch information
yangwooseong committed Sep 23, 2023
1 parent 632cd00 commit df75ffc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/generate-icon-files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,16 @@ jobs:
node packages/bezier-icons/scripts/generate-icon-files.js
git add .
git commit -m "feat(bezier-icons): generate icon files from icons.json" || echo "skipped commit due to no update"
- name: Get Pull Request Number
id: pr
run: echo "::set-output name=pull_request_number::$(gh pr view --json number -q .number || echo "")"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: echo ${{ steps.pr.outputs.pull_request_number }}

- name: Add pr description
run: |
node packages/bezier-icons/scripts/make-pr-description.js ${{ secrets.GITHUB_TOKEN }} ${{ github.event.number }}
node packages/bezier-icons/scripts/make-pr-description.js ${{ secrets.GITHUB_TOKEN }} ${{ steps.pr.outputs.pull_request_number }}
- name: Delete icons.json files
run: |
Expand Down
9 changes: 6 additions & 3 deletions packages/bezier-icons/scripts/make-pr-description.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
const { exec } = require('child_process')

const githubToken = process.argv[0]
const pullNumber = process.argv[1]
const githubToken = process.argv[3]
const pullNumber = process.argv[4]
console.log("LOG: ", githubToken)
console.log("LOG: ", pullNumber)

const keyToHeader = {
M: 'Modified 🖊️\n',
Expand Down Expand Up @@ -43,7 +45,7 @@ const getDescription = gitLog => {
exec('git log -1 --name-status --pretty="format:"', async (_undefined, stdout) => {
const description = getDescription(stdout)

await fetch(`https://api.github.com/repos/yangwooseong/bezier-react/${pullNumber}`, {
const res = await fetch(`https://api.github.com/repos/yangwooseong/bezier-react/${pullNumber}`, {
method: 'PATCH',
headers: {
'X-GitHub-Api-Version': '2022-11-28',
Expand All @@ -52,5 +54,6 @@ exec('git log -1 --name-status --pretty="format:"', async (_undefined, stdout) =
},
body: description,
})
console.log("LOG: ", res)
})

0 comments on commit df75ffc

Please sign in to comment.