Skip to content

Commit 7e75e63

Browse files
authored
Update daily-commit-check.yml
1 parent 56fcba0 commit 7e75e63

File tree

1 file changed

+36
-35
lines changed

1 file changed

+36
-35
lines changed

โ€Ž.github/workflows/daily-commit-check.ymlโ€Ž

Lines changed: 36 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -129,40 +129,38 @@ jobs:
129129
echo "no_commit_list=$NO_COMMIT_LIST" >> $GITHUB_OUTPUT
130130
fi
131131
132-
# ์ด์Šˆ ์ƒ์„ฑ ๊ธฐ๋Šฅ์€ ๊ถŒํ•œ ๋ฌธ์ œ๋กœ ์ฃผ์„ ์ฒ˜๋ฆฌ
133-
# Repository Settings > Actions > Workflow permissions๋ฅผ
134-
# "Read and write permissions"๋กœ ๋ณ€๊ฒฝํ•˜๋ฉด ์‚ฌ์šฉ ๊ฐ€๋Šฅ
135-
136-
# - name: Create Issue if there are missing commits
137-
# if: steps.check.outputs.no_commit_count != '0'
138-
# uses: actions/github-script@v7
139-
# with:
140-
# github-token: ${{ secrets.TOKEN || secrets.GITHUB_TOKEN }}
141-
# script: |
142-
# const yesterday = '${{ steps.check.outputs.yesterday }}';
143-
# const noCommitList = '${{ steps.check.outputs.no_commit_list }}'.split(',');
144-
# const count = '${{ steps.check.outputs.no_commit_count }}';
145-
#
146-
# const body = `## ๐Ÿ“Š ${yesterday} ์ปค๋ฐ‹ ์ฒดํฌ ๊ฒฐ๊ณผ
147-
#
148-
# **์ปค๋ฐ‹ํ•˜์ง€ ์•Š์€ ๋ฉค๋ฒ„: ${count}๋ช…**
149-
#
150-
# ${noCommitList.map(name => `- ${name} (๋ฒŒ๊ธˆ 5,000์›)`).join('\n')}
151-
#
152-
# ---
153-
#
154-
# ๐Ÿ’ฐ ์ด ๋ฒŒ๊ธˆ: ${parseInt(count) * 5000}์›
155-
#
156-
# โฐ ์ฒดํฌ ์‹œ๊ฐ„: ${new Date().toLocaleString('ko-KR', { timeZone: 'Asia/Seoul' })}`;
157-
#
158-
# // ์ด์Šˆ ์ƒ์„ฑ
159-
# await github.rest.issues.create({
160-
# owner: context.repo.owner,
161-
# repo: context.repo.repo,
162-
# title: `[${yesterday}] ์ปค๋ฐ‹ ๋ฏธ์ œ์ถœ ์•Œ๋ฆผ`,
163-
# body: body,
164-
# labels: ['daily-check', 'penalty']
165-
# });
132+
- name: Create daily check issue
133+
uses: actions/github-script@v7
134+
with:
135+
github-token: ${{ secrets.GITHUB_TOKEN }}
136+
script: |
137+
const yesterday = '${{ steps.check.outputs.yesterday }}';
138+
const noCommitList = '${{ steps.check.outputs.no_commit_list }}';
139+
const count = '${{ steps.check.outputs.no_commit_count }}';
140+
141+
let body = `## ๐Ÿ“Š ${yesterday} ์ปค๋ฐ‹ ์ฒดํฌ ๊ฒฐ๊ณผ\n\n`;
142+
143+
if (count === '0') {
144+
body += `๐ŸŽ‰ **๋ชจ๋“  ๋ฉค๋ฒ„๊ฐ€ ์ปค๋ฐ‹ํ–ˆ์Šต๋‹ˆ๋‹ค!**\n\n`;
145+
body += `์ด 10๋ช… ์ „์› ์ œ์ถœ ์™„๋ฃŒ โœ…`;
146+
} else {
147+
const members = noCommitList.split(',');
148+
body += `**์ปค๋ฐ‹ํ•˜์ง€ ์•Š์€ ๋ฉค๋ฒ„: ${count}๋ช…**\n\n`;
149+
body += members.map(name => `- ${name} (๋ฒŒ๊ธˆ 5,000์›)`).join('\n');
150+
body += `\n\n---\n\n`;
151+
body += `๐Ÿ’ฐ **์ด ๋ฒŒ๊ธˆ**: ${parseInt(count) * 5000}์›`;
152+
}
153+
154+
body += `\n\nโฐ ์ฒดํฌ ์‹œ๊ฐ„: ${new Date().toLocaleString('ko-KR', { timeZone: 'Asia/Seoul' })}`;
155+
156+
// ์ด์Šˆ ์ƒ์„ฑ
157+
await github.rest.issues.create({
158+
owner: context.repo.owner,
159+
repo: context.repo.repo,
160+
title: count === '0' ? `[${yesterday}] โœ… ์ „์› ์ œ์ถœ ์™„๋ฃŒ` : `[${yesterday}] โŒ ์ปค๋ฐ‹ ๋ฏธ์ œ์ถœ ์•Œ๋ฆผ`,
161+
body: body,
162+
labels: count === '0' ? ['daily-check', 'all-clear'] : ['daily-check', 'penalty']
163+
});
166164
167165
- name: Post detailed results
168166
if: steps.check.outputs.no_commit_count != '0'
@@ -173,7 +171,10 @@ jobs:
173171
echo "๋‚ ์งœ: ${{ steps.check.outputs.yesterday }}"
174172
echo "๋ฏธ์ œ์ถœ ์ธ์›: ${{ steps.check.outputs.no_commit_count }}๋ช…"
175173
echo "๋Œ€์ƒ์ž: ${{ steps.check.outputs.no_commit_list }}"
176-
echo "์ด ๋ฒŒ๊ธˆ: $(($${{ steps.check.outputs.no_commit_count }} * 5000))์›"
174+
175+
NO_COMMIT_COUNT="${{ steps.check.outputs.no_commit_count }}"
176+
PENALTY=$((NO_COMMIT_COUNT * 5000))
177+
echo "์ด ๋ฒŒ๊ธˆ: ${PENALTY}์›"
177178
echo "========================================="
178179
179180
- name: Print summary

0 commit comments

Comments
ย (0)