Skip to content

Commit

Permalink
feat: post github comment on pr
Browse files Browse the repository at this point in the history
  • Loading branch information
robproject committed Oct 22, 2023
1 parent 519bca1 commit 08ab045
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
24 changes: 23 additions & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,29 @@ jobs:
- name: Diff
run: |
git --no-pager diff HEAD~1 HEAD
git --no-pager diff HEAD~1 HEAD > diff_output.txt
- name: Convert ansi to html
if: github.event_name == 'pull_request'
run: |
pip install ansi2html
cat diff_output | ansi2html > diff_output.html
- name: Post comment
if: github.event_name == 'pull_request'
uses: actions/github-script@v6
with:
script: |
const fs = require('fs');
const output = fs.readFileSync('output.html', 'utf8');
const issue_number = context.issue.number;
github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue_number,
body: output,
});
Expand Down
3 changes: 1 addition & 2 deletions test_files/new_doctype_renamed_old.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@
},
{
"fieldname": "new_docfield_2",
"fieldtype": "Int",
"label": "New Docfield 2"
"fieldtype": "Int"
},
{
"fieldname": "new_docfield_3",
Expand Down

0 comments on commit 08ab045

Please sign in to comment.