@@ -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