|
3 | 3 | # on:
|
4 | 4 | # workflow_dispatch:
|
5 | 5 | # issues:
|
6 |
| -# types: [ opened, edited ] |
| 6 | +# types: [opened, edited] |
| 7 | +# issue_comment: |
| 8 | +# types: [created, edited] |
7 | 9 |
|
8 | 10 | # jobs:
|
9 | 11 | # check:
|
10 | 12 | # runs-on: ubuntu-latest
|
11 | 13 | # outputs:
|
12 | 14 | # phraseExists: ${{ steps.check-body.outputs.result }}
|
| 15 | +# commentId: ${{ steps.check-body.outputs.commentId }} |
13 | 16 | # steps:
|
14 |
| -# - name: Check if issue body contains 'Hey ontobot' |
| 17 | +# - name: Check if issue body or any comment contains 'Hey ontobot' |
15 | 18 | # id: check-body
|
16 | 19 | # uses: actions/github-script@v6
|
17 | 20 | # with:
|
|
21 | 24 | # repo: context.repo.repo,
|
22 | 25 | # issue_number: context.issue.number
|
23 | 26 | # });
|
24 |
| -# if (!issue.data.body) { |
25 |
| -# console.log('Issue body is empty or null'); |
26 |
| -# return false; |
| 27 | + |
| 28 | +# let bodyText = issue.data.body ? issue.data.body.toLowerCase() : ''; |
| 29 | +# let commentId = null; |
| 30 | + |
| 31 | +# const comments = await github.rest.issues.listComments({ |
| 32 | +# owner: context.repo.owner, |
| 33 | +# repo: context.repo.repo, |
| 34 | +# issue_number: context.issue.number |
| 35 | +# }); |
| 36 | + |
| 37 | +# for (const comment of comments.data) { |
| 38 | +# if (comment.body.toLowerCase().includes('hey ontobot')) { |
| 39 | +# bodyText += ' ' + comment.body.toLowerCase(); |
| 40 | +# commentId = comment.id; |
| 41 | +# } |
27 | 42 | # }
|
28 |
| -# return issue.data.body.includes('Hey ontobot'); |
| 43 | + |
| 44 | +# return { |
| 45 | +# result: bodyText.includes('hey ontobot'), |
| 46 | +# commentId: commentId |
| 47 | +# }; |
29 | 48 |
|
30 | 49 | # build:
|
31 | 50 | # needs: check
|
|
35 | 54 | # strategy:
|
36 | 55 | # matrix:
|
37 | 56 | # python-version: ["3.9"]
|
38 |
| -# os: [ ubuntu-latest ] |
| 57 | +# os: [ubuntu-latest] |
39 | 58 |
|
40 | 59 | # steps:
|
41 | 60 | # - name: Checkout main branch
|
|
45 | 64 | # id: gh-script-issue
|
46 | 65 | # uses: actions/github-script@v6
|
47 | 66 | # with:
|
48 |
| -# # github-token: ${{ secrets.GH_TOKEN }} |
49 | 67 | # script: |
|
50 |
| -# const issue_number = context.issue.number |
51 |
| -# const repo = context.repo.owner+"/"+context.repo.repo |
52 |
| -# return issue_number |
53 |
| - |
| 68 | +# const issue_number = context.issue.number; |
| 69 | +# return issue_number; |
| 70 | + |
54 | 71 | # - name: Return repository name
|
55 | 72 | # id: gh-script-repo
|
56 | 73 | # uses: actions/github-script@v6
|
57 | 74 | # with:
|
58 |
| -# # github-token: ${{ secrets.GH_TOKEN }} |
59 | 75 | # script: |
|
60 |
| -# const repo = context.repo.owner+"/"+context.repo.repo |
61 |
| -# return repo |
| 76 | +# const repo = context.repo.owner + "/" + context.repo.repo; |
| 77 | +# return repo; |
62 | 78 |
|
63 | 79 | # - name: Set branch name
|
64 | 80 | # id: vars
|
65 | 81 | # run: |
|
66 | 82 | # echo "resource=src/envo/envo-edit.owl" >> $GITHUB_ENV
|
67 |
| -# echo "branch-name=kgcl_automation_"${{ steps.gh-script-issue.outputs.result }} >> $GITHUB_ENV |
68 |
| - |
| 83 | +# echo "branch-name=kgcl_automation_${{ steps.gh-script-issue.outputs.result }}" >> $GITHUB_ENV |
| 84 | +# echo "comment-id=${{ needs.check.outputs.commentId }}" >> $GITHUB_ENV |
| 85 | + |
69 | 86 | # - name: Get jar & enable plugin.
|
70 | 87 | # run: |
|
71 | 88 | # mkdir -p robot-plugins
|
72 | 89 | # wget https://github.com/gouttegd/kgcl-java/releases/download/kgcl-java-0.3.2/kgcl-robot-plugin-0.3.2.jar -O robot-plugins/kgcl.jar
|
73 | 90 | # echo "ROBOT_PLUGINS_DIRECTORY=$(pwd)/robot-plugins/" >> "$GITHUB_ENV"
|
74 |
| - |
| 91 | + |
75 | 92 | # - name: Install dependencies
|
76 | 93 | # run: |
|
77 | 94 | # pip install ontobot-change-agent
|
|
82 | 99 | # ochange process-issue ${{ env.resource }} \
|
83 | 100 | # -r ${{ steps.gh-script-repo.outputs.result }} \
|
84 | 101 | # -n ${{ steps.gh-script-issue.outputs.result }} \
|
85 |
| -# -g ${{ secrets.GH_TOKEN }} |
| 102 | +# -g ${{ secrets.GH_TOKEN }} \ |
| 103 | +# -c ${{ env.comment-id }} |
86 | 104 | # # ! OR using standalone JAR file.
|
87 | 105 | # # ! ochange process-issue ${{ env.resource }} \
|
88 | 106 | # # ! -r ${{ steps.gh-script-repo.outputs.result }} \
|
89 | 107 | # # ! -n ${{ steps.gh-script-issue.outputs.result }} \
|
90 | 108 | # # ! -g ${{ secrets.GH_TOKEN }} \
|
| 109 | +# # ! -p ${{ env.comment-id }} \ |
91 | 110 | # # ! -j kgcl-robot.jar
|
92 | 111 |
|
93 | 112 | # - name: Clean-up
|
94 | 113 | # run: rm -rf robot-plugins
|
95 | 114 |
|
96 | 115 | # - name: Create Pull Request
|
97 | 116 | # uses: peter-evans/create-pull-request@v5
|
98 |
| -# if: ${{ env.PR_TITLE}} |
| 117 | +# if: ${{ env.PR_TITLE }} |
99 | 118 | # with:
|
100 | 119 | # token: ${{ secrets.GH_TOKEN }}
|
101 | 120 | # branch-suffix: short-commit-hash
|
|
0 commit comments