|
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 diff-md |
| 25 | +# run: | |
| 26 | +# cd src/ontology |
| 27 | +# make diff-md |
| 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 | +# 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 | +# const { owner, repo } = context.repo; |
| 42 | +# const { number } = context.issue; |
| 43 | +# const existingComments = await github.rest.issues.listComments({ |
| 44 | +# owner, |
| 45 | +# repo, |
| 46 | +# issue_number: number |
| 47 | +# }); |
| 48 | +# const existingComment = existingComments.data.find(comment => comment.user.login === 'github-actions[bot]'); |
| 49 | +# if (existingComment) { |
| 50 | +# await github.rest.issues.updateComment({ |
| 51 | +# owner, |
| 52 | +# repo, |
| 53 | +# comment_id: existingComment.id, |
| 54 | +# body: content |
| 55 | +# }); |
| 56 | +# } else { |
| 57 | +# await github.rest.issues.createComment({ |
| 58 | +# owner, |
| 59 | +# repo, |
| 60 | +# issue_number: number, |
| 61 | +# body: content |
| 62 | +# }); |
| 63 | +# } |
| 64 | +# } else { |
| 65 | +# console.log("The markdown file is empty."); // Debug print if the file is empty |
| 66 | +# } |
| 67 | +# } else { |
| 68 | +# console.log("The markdown file does not exist."); // Debug print if the file does not exist |
| 69 | +# } |
28 | 70 |
|
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 |
| -# const { owner, repo } = context.repo; |
42 |
| -# const { number } = context.issue; |
43 |
| -# const existingComments = await github.rest.issues.listComments({ |
44 |
| -# owner, |
45 |
| -# repo, |
46 |
| -# issue_number: number |
47 |
| -# }); |
48 |
| -# const existingComment = existingComments.data.find(comment => comment.user.login === 'github-actions[bot]'); |
49 |
| -# if (existingComment) { |
50 |
| -# await github.rest.issues.updateComment({ |
51 |
| -# owner, |
52 |
| -# repo, |
53 |
| -# comment_id: existingComment.id, |
54 |
| -# body: content |
55 |
| -# }); |
56 |
| -# } else { |
57 |
| -# await github.rest.issues.createComment({ |
58 |
| -# owner, |
59 |
| -# repo, |
60 |
| -# issue_number: number, |
61 |
| -# body: content |
62 |
| -# }); |
63 |
| -# } |
64 |
| -# } else { |
65 |
| -# console.log("The markdown file is empty."); // Debug print if the file is empty |
66 |
| -# } |
67 |
| -# } else { |
68 |
| -# console.log("The markdown file does not exist."); // Debug print if the file does not exist |
69 |
| -# } |
|
0 commit comments