Skip to content

Commit e263dec

Browse files
committed
fix: add output to action.yml
1 parent af84ea1 commit e263dec

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

.github/workflows/commit-check.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,15 @@ jobs:
3434
- name: Save PR comments to pr-comments.txt
3535
run: echo "${{ steps.commit-check.outputs.pr_comments }}" > pr-comments.txt
3636

37-
- name: Upload pr-comments.txt
38-
uses: actions/upload-artifact@v4
37+
- name: Post PR comments
38+
uses: actions/github-script@v6
3939
with:
40-
name: commit-check-pr-comments
41-
path: pr-comments.txt
40+
script: |
41+
const fs = require('fs');
42+
const content = fs.readFileSync('pr-comments.txt', 'utf8');
43+
github.rest.issues.createComment({
44+
issue_number: context.issue.number,
45+
owner: context.repo.owner,
46+
repo: context.repo.repo,
47+
body: content
48+
});

main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def set_pr_comments_output() -> None:
116116
if result_text is None
117117
else f"{FAILURE_TITLE}\n```\n{result_text}\n```"
118118
)
119-
119+
120120
# output pr_comments to $GITHUB_OUTPUT
121121
with open(os.environ["GITHUB_OUTPUT"], "a", encoding="utf-8") as output_file:
122122
output_file.write(f"pr_comments={pr_comments}\n")
@@ -213,7 +213,7 @@ def main():
213213
ret_code = run_commit_check()
214214
ret_code += add_job_summary()
215215
ret_code += add_pr_comments()
216-
216+
217217
# Always set pr_comments output regardless of PR_COMMENTS setting
218218
set_pr_comments_output()
219219

0 commit comments

Comments
 (0)