|
1 | 1 | # name: Post Markdown Comment on Pull Request
|
2 | 2 |
|
3 | 3 | # on:
|
4 |
| -# workflow_dispatch: |
5 |
| -# pull_request: |
6 |
| -# types: [opened, synchronize] |
| 4 | +# workflow_dispatch: |
| 5 | +# pull_request: |
| 6 | +# types: [opened, synchronize] |
7 | 7 |
|
8 | 8 | # jobs:
|
9 |
| -# post-comment: |
10 |
| -# runs-on: ubuntu-latest |
| 9 | +# post-comment: |
| 10 | +# runs-on: ubuntu-latest |
11 | 11 |
|
12 |
| -# steps: |
13 |
| -# - name: Checkout repository |
14 |
| -# uses: actions/checkout@v4 |
| 12 | +# steps: |
| 13 | +# - name: Checkout repository |
| 14 | +# uses: actions/checkout@v4 |
15 | 15 |
|
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' |
20 | 20 |
|
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 |
23 | 23 |
|
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 | +# } |
28 | 46 |
|
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) { |
41 | 47 | # const { owner, repo } = context.repo;
|
42 | 48 | # const { number } = context.issue;
|
43 | 49 | # const existingComments = await github.rest.issues.listComments({
|
|
48 | 54 | # const existingComment = existingComments.data.find(comment => comment.user.login === 'github-actions[bot]');
|
49 | 55 | # if (existingComment) {
|
50 | 56 | # 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 |
55 | 61 | # });
|
56 | 62 | # } else {
|
57 | 63 | # 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 |
62 | 68 | # });
|
63 | 69 | # }
|
64 |
| -# } else { |
65 |
| -# console.log("The markdown file is empty."); // Debug print if the file is empty |
66 |
| -# } |
67 | 70 | # } 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 |
69 | 72 | # }
|
70 |
| - |
| 73 | +# } else { |
| 74 | +# console.log("The markdown file does not exist."); // Debug print if the file does not exist |
| 75 | +# } |
0 commit comments