Skip to content

Commit

Permalink
Remove issue comment part
Browse files Browse the repository at this point in the history
  • Loading branch information
aahung committed Feb 9, 2023
1 parent 781b887 commit 6916b35
Showing 1 changed file with 4 additions and 34 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
name: Check interface compatibility
name: Check compatibility

on:
pull_request:

permissions:
pull-requests: write

jobs:
check-interface-compatibility:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -47,35 +44,8 @@ jobs:
exit_code=0
output=$(bin/public_interface.py check "${{ runner.temp }}"/interfaces.original.json "${{ runner.temp }}"/interfaces.new.json) || exit_code=$?
# Show the output in job summary
echo "$output" >> $GITHUB_STEP_SUMMARY
# Update steps.detect.outputs.change_detected=true for next steps
if [ "$exit_code" -ne 0 ]; then
echo "change_detected=true" >> $GITHUB_OUTPUT
# Show the output in job summary and fail the workflow
echo "$output" >> $GITHUB_STEP_SUMMARY
exit 1
fi
# Save the output for next step to process it,
# and saving it into a file can avoid the need of escaping in github-script.
echo "$output" > "${{ runner.temp }}"/output.md
- name: Post GitHub PR comment
if: ${{ steps.detect.outputs.change_detected }}
uses: actions/github-script@v6
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const fs = require('fs');
const output = fs.readFileSync('${{ runner.temp }}/output.md', 'utf8')
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: output
})
- name: Show detection output
if: ${{ steps.detect.outputs.change_detected }}
run: |
cat "${{ runner.temp }}"/output.md
exit 1

0 comments on commit 6916b35

Please sign in to comment.