Skip to content

Commit 1c123d7

Browse files
committed
fix: add output to action.yml
1 parent 6b16407 commit 1c123d7

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

.github/workflows/commit-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Commit Check
22

33
on:
44
pull_request:
5-
branches: 'main'
5+
branches: [ 'main' ]
66
workflow_dispatch:
77

88
jobs:

action.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ inputs:
4848
runs:
4949
using: "composite"
5050
steps:
51-
- name: Install dependencies and run commit-check
51+
- id: run
52+
name: Install dependencies and run commit-check
5253
shell: bash
5354
run: |
5455
if [[ "$RUNNER_OS" == "Linux" ]]; then
@@ -84,3 +85,8 @@ runs:
8485
DRY_RUN: ${{ inputs.dry-run }}
8586
JOB_SUMMARY: ${{ inputs.job-summary }}
8687
PR_COMMENTS: ${{ inputs.pr-comments }}
88+
89+
outputs:
90+
pr_comments:
91+
description: The formatted PR comment body containing commit-check results
92+
value: ${{ steps.run.outputs.pr_comments }}

main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,8 @@ def add_pr_comments() -> int:
169169
pull_request.create_comment(body=pr_comments)
170170

171171
# output pr_comments to $GITHUB_OUTPUT
172-
with open(os.environ["GITHUB_OUTPUT"], "a", encoding="utf-8") as env_file:
173-
env_file.write(f"pr_comments={pr_comments}\n")
172+
with open(os.environ["GITHUB_OUTPUT"], "a", encoding="utf-8") as output_file:
173+
output_file.write(f"pr_comments={pr_comments}\n")
174174

175175
return 0 if result_text is None else 1
176176
except Exception as e:

0 commit comments

Comments
 (0)