Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(actions): update comment #239

Merged
merged 4 commits into from
Jun 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 37 additions & 8 deletions .github/actions/netlify-preview/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,28 +36,57 @@ runs:
echo "NETLIFY_PREVIEW_URL=$NETLIFY_PREVIEW_URL" >> "$GITHUB_OUTPUT"

- name: Comment URL Preview on PR
# https://octokit.github.io/rest.js/v20
uses: actions/github-script@v7
env:
NETLIFY_PREVIEW_URL: ${{ steps.url-preview.outputs.NETLIFY_PREVIEW_URL }}
HEAD_COMMIT: ${{ inputs.HEAD_COMMIT }}
with:
script: |
async function comment(){
const owner = context.repo.owner;
const repo = context.repo.repo;

async function getIssueNumber() {
const result = await github.rest.repos.listPullRequestsAssociatedWithCommit({
owner: context.repo.owner,
repo: context.repo.repo,
owner,
repo,
commit_sha: process.env.HEAD_COMMIT,
});
const issueNumber = result.data[0]?.number;
if (issueNumber) {
return issueNumber;
}

async function getExistPrevActionBot(issueNumber) {
const result = await github.rest.issues.listComments({
owner,
repo,
issue_number: issueNumber
});
const existPrevAction = result.data.find(comment => comment.user.login === 'github-actions[bot]');
return existPrevAction;
}

async function comment(){
const issueNumber = await getIssueNumber();
if (!issueNumber) {
console.log('No PR found for commit ' + process.env.HEAD_COMMIT);
return;
}
const prevActionBot = await getExistPrevActionBot(issueNumber);
if (prevActionBot.id) {
await github.rest.issues.updateComment({
owner,
repo,
comment_id: prevActionBot.id,
body: `Preview URL: ${process.env.NETLIFY_PREVIEW_URL}`
});
} else {
await github.rest.issues.createComment({
owner,
repo,
issue_number: issueNumber,
owner: context.repo.owner,
repo: context.repo.repo,
body: `Preview URL: ${process.env.NETLIFY_PREVIEW_URL}`
});
} else {
console.log('No PR found for commit ' + process.env.HEAD_COMMIT);
}
}
comment();
2 changes: 1 addition & 1 deletion e2e/__snapshots__/404.spec.ts/desktop/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

Do you enjoy surfing?

</code><div class="small">Image Copyright:&nbsp;<a class="highlighter" href="https://kr.freepik.com/free-vector/isometric-summer-beach-vacation-concept_9515534.htm" rel="noopener noreferrer" target="_blank">Freepik</a></div></pre></div><footer class="footer"><ul><li><a href="/about">1ilsang</a></li><li><a rel="noopener noreferrer" target="_blank" href="https://github.com/1ilsang">GitHub</a></li><li><a href="https://www.linkedin.com/in/sang-chul-lee-91a32b154/" rel="noopener noreferrer" target="_blank">LinkedIn</a></li></ul></footer>
</code><div class="small">Image Copyright:&nbsp;<a class="highlighter" href="https://kr.freepik.com/free-vector/isometric-summer-beach-vacation-concept_9515534.htm" rel="noopener noreferrer" target="_blank">Freepik</a></div></pre></div><footer class="footer"><ul><li><a href="/about">1ilsang</a></li><li><a rel="noopener noreferrer" target="_blank" href="https://github.com/1ilsang">GitHub</a></li><li><a href="https://www.linkedin.com/in/1ilsang" rel="noopener noreferrer" target="_blank">LinkedIn</a></li></ul></footer>
2 changes: 1 addition & 1 deletion e2e/__snapshots__/404.spec.ts/mobile/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

Do you enjoy surfing?

</code><div class="small">Image Copyright:&nbsp;<a class="highlighter" href="https://kr.freepik.com/free-vector/isometric-summer-beach-vacation-concept_9515534.htm" rel="noopener noreferrer" target="_blank">Freepik</a></div></pre></div><footer class="footer"><ul><li><a href="/about">1ilsang</a></li><li><a rel="noopener noreferrer" target="_blank" href="https://github.com/1ilsang">GitHub</a></li><li><a href="https://www.linkedin.com/in/sang-chul-lee-91a32b154/" rel="noopener noreferrer" target="_blank">LinkedIn</a></li></ul></footer>
</code><div class="small">Image Copyright:&nbsp;<a class="highlighter" href="https://kr.freepik.com/free-vector/isometric-summer-beach-vacation-concept_9515534.htm" rel="noopener noreferrer" target="_blank">Freepik</a></div></pre></div><footer class="footer"><ul><li><a href="/about">1ilsang</a></li><li><a rel="noopener noreferrer" target="_blank" href="https://github.com/1ilsang">GitHub</a></li><li><a href="https://www.linkedin.com/in/1ilsang" rel="noopener noreferrer" target="_blank">LinkedIn</a></li></ul></footer>
2 changes: 1 addition & 1 deletion e2e/__snapshots__/about.spec.ts/desktop/about.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion e2e/__snapshots__/about.spec.ts/mobile/about.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion e2e/__snapshots__/post/dom.spec.ts/desktop/2023.html
Original file line number Diff line number Diff line change
Expand Up @@ -137,4 +137,4 @@ <h2 id="신년-목표" data-heading="true"><a data-heading="true" href="#신년-
</ul>
</li>
</ol>
<p>2024년 잘 부탁드립니다.</p></div><aside class="floating-container"><ul class="list"><li data-id="2022년의-목표" class="item">2022년의 목표</li><li data-id="keep" class="item">Keep</li><li><ul class="depth-ul"><li data-id="기술적-관심" class="item depth">기술적 관심</li><li data-id="회사" class="item depth">회사</li><li data-id="대외활동" class="item depth">대외활동</li><li data-id="운동" class="item depth">운동</li><li data-id="여행" class="item depth">여행</li><li data-id="독서" class="item depth">독서</li></ul></li><li data-id="problem" class="item">Problem</li><li><ul class="depth-ul"><li data-id="데이터의-파편화" class="item depth">데이터의 파편화</li><li data-id="기술-갈증" class="item depth">기술 갈증</li><li data-id="생활" class="item depth">생활</li></ul></li><li data-id="try" class="item">Try</li><li data-id="총평" class="item">총평</li><li data-id="신년-목표" class="item">신년 목표</li></ul></aside></div><a class="highlighter issue-post" href="https://github.com/1ilsang/dev/issues/new?labels=🧊 comment&amp;assignees=1ilsang&amp;title=[🧊] 2023%20%ED%9A%8C%EA%B3%A0%EB%A1%9D&amp;body=<!-- 환영합니다. 이슈 남겨주시면 빠르게 답변드리겠습니다. 🙇 -->" rel="noopener noreferrer" target="_blank">📮 이 포스트에 관심 있으신가요? 이슈를 남겨주세요! 👍</a></div><footer class="footer"><ul><li><a href="/about">1ilsang</a></li><li><a rel="noopener noreferrer" target="_blank" href="https://github.com/1ilsang">GitHub</a></li><li><a href="https://www.linkedin.com/in/sang-chul-lee-91a32b154/" rel="noopener noreferrer" target="_blank">LinkedIn</a></li></ul></footer>
<p>2024년 잘 부탁드립니다.</p></div><aside class="floating-container"><ul class="list"><li data-id="2022년의-목표" class="item">2022년의 목표</li><li data-id="keep" class="item">Keep</li><li><ul class="depth-ul"><li data-id="기술적-관심" class="item depth">기술적 관심</li><li data-id="회사" class="item depth">회사</li><li data-id="대외활동" class="item depth">대외활동</li><li data-id="운동" class="item depth">운동</li><li data-id="여행" class="item depth">여행</li><li data-id="독서" class="item depth">독서</li></ul></li><li data-id="problem" class="item">Problem</li><li><ul class="depth-ul"><li data-id="데이터의-파편화" class="item depth">데이터의 파편화</li><li data-id="기술-갈증" class="item depth">기술 갈증</li><li data-id="생활" class="item depth">생활</li></ul></li><li data-id="try" class="item">Try</li><li data-id="총평" class="item">총평</li><li data-id="신년-목표" class="item">신년 목표</li></ul></aside></div><a class="highlighter issue-post" href="https://github.com/1ilsang/dev/issues/new?labels=🧊 comment&amp;assignees=1ilsang&amp;title=[🧊] 2023%20%ED%9A%8C%EA%B3%A0%EB%A1%9D&amp;body=<!-- 환영합니다. 이슈 남겨주시면 빠르게 답변드리겠습니다. 🙇 -->" rel="noopener noreferrer" target="_blank">📮 이 포스트에 관심 있으신가요? 이슈를 남겨주세요! 👍</a></div><footer class="footer"><ul><li><a href="/about">1ilsang</a></li><li><a rel="noopener noreferrer" target="_blank" href="https://github.com/1ilsang">GitHub</a></li><li><a href="https://www.linkedin.com/in/1ilsang" rel="noopener noreferrer" target="_blank">LinkedIn</a></li></ul></footer>
2 changes: 1 addition & 1 deletion e2e/__snapshots__/post/dom.spec.ts/desktop/2024-01.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ <h2 id="운동하기" data-heading="true"><a data-heading="true" href="#운동
<p>다음 달에는 좀 더 트레이닝해야겠다.</p>
<h2 id="마치며" data-heading="true"><a data-heading="true" href="#마치며"><span class="icon icon-link"></span></a>마치며</h2>
<p>2월에는 현상 유지하면서 책 한 권만 읽으면 좋을 것 같다.</p>
<p>가보자고!</p></div><aside class="floating-container"><ul class="list"><li data-id="2024년-1월의-목표" class="item">2024년 1월의 목표</li><li data-id="2d1r" class="item">2D1R</li><li data-id="월간-다이브" class="item">월간 다이브</li><li data-id="월간-메이커스" class="item">월간 메이커스</li><li data-id="말해보카" class="item">말해보카</li><li data-id="운동하기" class="item">운동하기</li><li data-id="마치며" class="item">마치며</li></ul></aside></div><a class="highlighter issue-post" href="https://github.com/1ilsang/dev/issues/new?labels=🧊 comment&amp;assignees=1ilsang&amp;title=[🧊] 2024%EB%85%84%201%EC%9B%94%20%ED%9A%8C%EA%B3%A0&amp;body=<!-- 환영합니다. 이슈 남겨주시면 빠르게 답변드리겠습니다. 🙇 -->" rel="noopener noreferrer" target="_blank">📮 이 포스트에 관심 있으신가요? 이슈를 남겨주세요! 👍</a></div><footer class="footer"><ul><li><a href="/about">1ilsang</a></li><li><a rel="noopener noreferrer" target="_blank" href="https://github.com/1ilsang">GitHub</a></li><li><a href="https://www.linkedin.com/in/sang-chul-lee-91a32b154/" rel="noopener noreferrer" target="_blank">LinkedIn</a></li></ul></footer>
<p>가보자고!</p></div><aside class="floating-container"><ul class="list"><li data-id="2024년-1월의-목표" class="item">2024년 1월의 목표</li><li data-id="2d1r" class="item">2D1R</li><li data-id="월간-다이브" class="item">월간 다이브</li><li data-id="월간-메이커스" class="item">월간 메이커스</li><li data-id="말해보카" class="item">말해보카</li><li data-id="운동하기" class="item">운동하기</li><li data-id="마치며" class="item">마치며</li></ul></aside></div><a class="highlighter issue-post" href="https://github.com/1ilsang/dev/issues/new?labels=🧊 comment&amp;assignees=1ilsang&amp;title=[🧊] 2024%EB%85%84%201%EC%9B%94%20%ED%9A%8C%EA%B3%A0&amp;body=<!-- 환영합니다. 이슈 남겨주시면 빠르게 답변드리겠습니다. 🙇 -->" rel="noopener noreferrer" target="_blank">📮 이 포스트에 관심 있으신가요? 이슈를 남겨주세요! 👍</a></div><footer class="footer"><ul><li><a href="/about">1ilsang</a></li><li><a rel="noopener noreferrer" target="_blank" href="https://github.com/1ilsang">GitHub</a></li><li><a href="https://www.linkedin.com/in/1ilsang" rel="noopener noreferrer" target="_blank">LinkedIn</a></li></ul></footer>
Original file line number Diff line number Diff line change
Expand Up @@ -398,4 +398,4 @@ <h2 id="참고" data-heading="true"><a data-heading="true" href="#참고"><span
<li><a class="underline-highlight-fade" target="_blank" href="https://timothygu.me/es-howto" rel="noreferrer noopener">https://timothygu.me/es-howto</a></li>
<li><a class="underline-highlight-fade" target="_blank" href="https://v8.dev/blog/array-sort" rel="noreferrer noopener">https://v8.dev/blog/array-sort</a></li>
<li><a class="underline-highlight-fade" target="_blank" href="https://www.youtube.com/watch?v=HHN1axRRKx8" rel="noreferrer noopener">자료구조 Tim 정렬 알고리즘</a></li>
</ul></div><aside class="floating-container"><ul class="list"><li data-id="index" class="item">Index</li><li data-id="tldr" class="item">TL;DR!</li><li data-id="의문의-시작" class="item">의문의 시작</li><li data-id="arrayprototypesort-공식-명세" class="item">Array.prototype.sort() 공식 명세</li><li><ul class="depth-ul"><li data-id="231330-arrayprototypesort-comparefn" class="item depth">23.1.3.30 Array.prototype.sort (compareFn)</li></ul></li><li data-id="브라우저별-sort-구현체" class="item">브라우저별 Sort 구현체</li><li><ul class="depth-ul"><li data-id="v8" class="item depth">V8</li><li data-id="webkit" class="item depth">Webkit</li><li data-id="spidermonkey" class="item depth">SpiderMonkey</li><li data-id="정리" class="item depth">정리</li></ul></li><li data-id="마무리" class="item">마무리</li><li data-id="참고" class="item">참고</li></ul></aside></div><a class="highlighter issue-post" href="https://github.com/1ilsang/dev/issues/new?labels=🧊 comment&amp;assignees=1ilsang&amp;title=[🧊] Array.prototype.sort()%20%EC%9D%B4%ED%95%B4%ED%95%98%EA%B8%B0&amp;body=<!-- 환영합니다. 이슈 남겨주시면 빠르게 답변드리겠습니다. 🙇 -->" rel="noopener noreferrer" target="_blank">📮 이 포스트에 관심 있으신가요? 이슈를 남겨주세요! 👍</a></div><footer class="footer"><ul><li><a href="/about">1ilsang</a></li><li><a rel="noopener noreferrer" target="_blank" href="https://github.com/1ilsang">GitHub</a></li><li><a href="https://www.linkedin.com/in/sang-chul-lee-91a32b154/" rel="noopener noreferrer" target="_blank">LinkedIn</a></li></ul></footer>
</ul></div><aside class="floating-container"><ul class="list"><li data-id="index" class="item">Index</li><li data-id="tldr" class="item">TL;DR!</li><li data-id="의문의-시작" class="item">의문의 시작</li><li data-id="arrayprototypesort-공식-명세" class="item">Array.prototype.sort() 공식 명세</li><li><ul class="depth-ul"><li data-id="231330-arrayprototypesort-comparefn" class="item depth">23.1.3.30 Array.prototype.sort (compareFn)</li></ul></li><li data-id="브라우저별-sort-구현체" class="item">브라우저별 Sort 구현체</li><li><ul class="depth-ul"><li data-id="v8" class="item depth">V8</li><li data-id="webkit" class="item depth">Webkit</li><li data-id="spidermonkey" class="item depth">SpiderMonkey</li><li data-id="정리" class="item depth">정리</li></ul></li><li data-id="마무리" class="item">마무리</li><li data-id="참고" class="item">참고</li></ul></aside></div><a class="highlighter issue-post" href="https://github.com/1ilsang/dev/issues/new?labels=🧊 comment&amp;assignees=1ilsang&amp;title=[🧊] Array.prototype.sort()%20%EC%9D%B4%ED%95%B4%ED%95%98%EA%B8%B0&amp;body=<!-- 환영합니다. 이슈 남겨주시면 빠르게 답변드리겠습니다. 🙇 -->" rel="noopener noreferrer" target="_blank">📮 이 포스트에 관심 있으신가요? 이슈를 남겨주세요! 👍</a></div><footer class="footer"><ul><li><a href="/about">1ilsang</a></li><li><a rel="noopener noreferrer" target="_blank" href="https://github.com/1ilsang">GitHub</a></li><li><a href="https://www.linkedin.com/in/1ilsang" rel="noopener noreferrer" target="_blank">LinkedIn</a></li></ul></footer>
Original file line number Diff line number Diff line change
Expand Up @@ -204,4 +204,4 @@ <h2 id="추천하는-장소" data-heading="true"><a data-heading="true" href="#
<p>ETC</p>
<ul>
<li><a class="underline-highlight-fade" target="_blank" href="https://maps.app.goo.gl/nKpy2WibQLfbKvgU8" rel="noreferrer noopener">USAT Liberty Shipwreck</a></li>
</ul></div><aside class="floating-container"><ul class="list"><li data-id="시작-계기" class="item">시작 계기</li><li data-id="알아보기" class="item">알아보기</li><li><ul class="depth-ul"><li data-id="면적" class="item depth">면적</li><li data-id="시차" class="item depth">시차</li><li data-id="날씨" class="item depth">날씨</li><li data-id="종교" class="item depth">종교</li><li data-id="물가" class="item depth">물가</li><li data-id="항공편" class="item depth">항공편</li><li data-id="숙소" class="item depth">숙소</li><li data-id="전기-및-통신" class="item depth">전기 및 통신</li><li data-id="교통" class="item depth">교통</li></ul></li><li data-id="한-달간의-여정" class="item">한 달간의 여정</li><li data-id="벌써-마지막-주" class="item">벌써 마지막 주</li><li data-id="마무리" class="item">마무리</li><li data-id="추천하는-장소" class="item">추천하는 장소</li></ul></aside></div><a class="highlighter issue-post" href="https://github.com/1ilsang/dev/issues/new?labels=🧊 comment&amp;assignees=1ilsang&amp;title=[🧊] %EB%B0%9C%EB%A6%AC%20%ED%95%9C%20%EB%8B%AC%20%EB%A6%AC%EB%AA%A8%ED%8A%B8%20%EC%9B%8C%ED%81%AC%20%ED%9B%84%EA%B8%B0&amp;body=<!-- 환영합니다. 이슈 남겨주시면 빠르게 답변드리겠습니다. 🙇 -->" rel="noopener noreferrer" target="_blank">📮 이 포스트에 관심 있으신가요? 이슈를 남겨주세요! 👍</a></div><footer class="footer"><ul><li><a href="/about">1ilsang</a></li><li><a rel="noopener noreferrer" target="_blank" href="https://github.com/1ilsang">GitHub</a></li><li><a href="https://www.linkedin.com/in/sang-chul-lee-91a32b154/" rel="noopener noreferrer" target="_blank">LinkedIn</a></li></ul></footer>
</ul></div><aside class="floating-container"><ul class="list"><li data-id="시작-계기" class="item">시작 계기</li><li data-id="알아보기" class="item">알아보기</li><li><ul class="depth-ul"><li data-id="면적" class="item depth">면적</li><li data-id="시차" class="item depth">시차</li><li data-id="날씨" class="item depth">날씨</li><li data-id="종교" class="item depth">종교</li><li data-id="물가" class="item depth">물가</li><li data-id="항공편" class="item depth">항공편</li><li data-id="숙소" class="item depth">숙소</li><li data-id="전기-및-통신" class="item depth">전기 및 통신</li><li data-id="교통" class="item depth">교통</li></ul></li><li data-id="한-달간의-여정" class="item">한 달간의 여정</li><li data-id="벌써-마지막-주" class="item">벌써 마지막 주</li><li data-id="마무리" class="item">마무리</li><li data-id="추천하는-장소" class="item">추천하는 장소</li></ul></aside></div><a class="highlighter issue-post" href="https://github.com/1ilsang/dev/issues/new?labels=🧊 comment&amp;assignees=1ilsang&amp;title=[🧊] %EB%B0%9C%EB%A6%AC%20%ED%95%9C%20%EB%8B%AC%20%EB%A6%AC%EB%AA%A8%ED%8A%B8%20%EC%9B%8C%ED%81%AC%20%ED%9B%84%EA%B8%B0&amp;body=<!-- 환영합니다. 이슈 남겨주시면 빠르게 답변드리겠습니다. 🙇 -->" rel="noopener noreferrer" target="_blank">📮 이 포스트에 관심 있으신가요? 이슈를 남겨주세요! 👍</a></div><footer class="footer"><ul><li><a href="/about">1ilsang</a></li><li><a rel="noopener noreferrer" target="_blank" href="https://github.com/1ilsang">GitHub</a></li><li><a href="https://www.linkedin.com/in/1ilsang" rel="noopener noreferrer" target="_blank">LinkedIn</a></li></ul></footer>
Loading