Skip to content

Commit 65333e5

Browse files
committed
latest version
1 parent fdad22f commit 65333e5

File tree

1 file changed

+48
-43
lines changed

1 file changed

+48
-43
lines changed
+48-43
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,49 @@
11
# name: Post Markdown Comment on Pull Request
22

33
# on:
4-
# workflow_dispatch:
5-
# pull_request:
6-
# types: [opened, synchronize]
4+
# workflow_dispatch:
5+
# pull_request:
6+
# types: [opened, synchronize]
77

88
# jobs:
9-
# post-comment:
10-
# runs-on: ubuntu-latest
9+
# post-comment:
10+
# runs-on: ubuntu-latest
1111

12-
# steps:
13-
# - name: Checkout repository
14-
# uses: actions/checkout@v4
12+
# steps:
13+
# - name: Checkout repository
14+
# uses: actions/checkout@v4
1515

16-
# - name: Set up Python 3.10
17-
# uses: actions/setup-python@v5
18-
# with:
19-
# python-version: '3.10'
16+
# - name: Set up Python 3.10
17+
# uses: actions/setup-python@v5
18+
# with:
19+
# python-version: '3.10'
2020

21-
# - name: Install oaklib
22-
# run: pip install git+https://github.com/INCATools/ontology-access-kit.git@release-notes-emit
21+
# - name: Install oaklib
22+
# run: pip install git+https://github.com/INCATools/ontology-access-kit.git@release-notes-emit
2323

24-
# - name: Run make diff-md
25-
# run: |
26-
# cd src/ontology
27-
# make diff-md
24+
# - name: Run make kgcl-diff-md-main-branch-base
25+
# run: |
26+
# cd src/ontology
27+
# make kgcl-diff-md-main-branch-base
28+
29+
# # Post or update comment on pull request if difference_md.md exists
30+
# - name: Post or update comment on pull request
31+
# uses: actions/github-script@v7
32+
# with:
33+
# script: |
34+
# const fs = require('fs');
35+
# const path = 'src/ontology/reports/difference_md.md';
36+
# if (fs.existsSync(path)) {
37+
# let content = fs.readFileSync(path, 'utf8');
38+
# if (content) {
39+
# // GitHub's max issue body size is approximately 65536 characters
40+
# const maxBodySize = 65536;
41+
# const truncateMsg = '\n\n... [truncated due to excessive length] ...';
42+
# if (content.length > maxBodySize) {
43+
# // Truncate the content to fit within the GitHub comment size limit
44+
# content = content.substring(0, maxBodySize - truncateMsg.length) + truncateMsg;
45+
# }
2846

29-
# # Post or update comment on pull request if difference_md.md exists
30-
# - name: Post or update comment on pull request
31-
# uses: actions/github-script@v7
32-
# with:
33-
# script: |
34-
# const fs = require('fs');
35-
# const path = 'src/ontology/reports/difference_md.md';
36-
# if (fs.existsSync(path)) {
37-
# const content = fs.readFileSync(path, 'utf8');
38-
# console.log("Content of the markdown file:");
39-
# console.log(content); // Debug print of the file content
40-
# if (content) {
4147
# const { owner, repo } = context.repo;
4248
# const { number } = context.issue;
4349
# const existingComments = await github.rest.issues.listComments({
@@ -48,23 +54,22 @@
4854
# const existingComment = existingComments.data.find(comment => comment.user.login === 'github-actions[bot]');
4955
# if (existingComment) {
5056
# await github.rest.issues.updateComment({
51-
# owner,
52-
# repo,
53-
# comment_id: existingComment.id,
54-
# body: content
57+
# owner,
58+
# repo,
59+
# comment_id: existingComment.id,
60+
# body: content
5561
# });
5662
# } else {
5763
# await github.rest.issues.createComment({
58-
# owner,
59-
# repo,
60-
# issue_number: number,
61-
# body: content
64+
# owner,
65+
# repo,
66+
# issue_number: number,
67+
# body: content
6268
# });
6369
# }
64-
# } else {
65-
# console.log("The markdown file is empty."); // Debug print if the file is empty
66-
# }
6770
# } else {
68-
# console.log("The markdown file does not exist."); // Debug print if the file does not exist
71+
# console.log("The markdown file is empty."); // Debug print if the file is empty
6972
# }
70-
73+
# } else {
74+
# console.log("The markdown file does not exist."); // Debug print if the file does not exist
75+
# }

0 commit comments

Comments
 (0)