|
11 | 11 | # check:
|
12 | 12 | # runs-on: ubuntu-latest
|
13 | 13 | # outputs:
|
14 |
| -# phraseExists: ${{ steps.check-body.outputs.result }} |
| 14 | +# phraseExists: ${{ steps.check-body.outputs.phraseExists }} |
15 | 15 | # commentId: ${{ steps.check-body.outputs.commentId }}
|
16 | 16 | # steps:
|
17 | 17 | # - name: Check if issue body or any comment contains 'Hey ontobot'
|
18 | 18 | # id: check-body
|
19 |
| -# uses: actions/github-script@v6 |
| 19 | +# uses: actions/github-script@v7 |
20 | 20 | # with:
|
21 | 21 | # script: |
|
22 | 22 | # const issue = await github.rest.issues.get({
|
|
53 | 53 |
|
54 | 54 | # return result;
|
55 | 55 | # }
|
56 |
| - |
57 |
| -# // Check each comment |
58 | 56 |
|
59 |
| -# for (let comment of comments.reverse()) { // Reverse to give precedence to the latest comment |
60 |
| -# if (comment.body.toLowerCase().includes(phrase)) { |
| 57 | +# // Check each comment |
| 58 | +# let result = false; |
| 59 | +# for (let comment of comments.data.reverse()) { // Reverse to give precedence to the latest comment |
| 60 | +# if (comment.body.toLowerCase().includes('hey ontobot')) { |
61 | 61 | # result = true;
|
62 | 62 | # commentId = comment.id;
|
63 | 63 | # break;
|
64 |
| -# } |
65 |
| -# } |
66 |
| - |
67 |
| - |
68 |
| -# return { |
69 |
| -# result: result, |
70 |
| -# commentId: result ? commentId : null |
71 |
| -# }; |
| 64 | +# } |
72 | 65 | # }
|
73 | 66 |
|
74 | 67 | # const checkResult = checkForPhrase(bodyText, comments.data);
|
75 | 68 |
|
76 |
| -# console.log(`Result: ${checkResult.result}`); |
77 |
| -# console.log(`Comment ID: ${checkResult.commentId}`); |
78 |
| -# console.log(`Check Result: ${JSON.stringify(checkResult)}`); |
| 69 | +# console.log(`Result: ${checkResult}`); |
| 70 | +# console.log(`Comment ID: ${commentId}`); |
79 | 71 |
|
80 |
| -# core.setOutput('phraseExists', checkResult.result); |
81 |
| -# core.setOutput('commentId', checkResult.commentId); |
| 72 | +# core.setOutput('phraseExists', checkResult); |
| 73 | +# core.setOutput('commentId', commentId); |
82 | 74 |
|
83 | 75 | # - name: Log phraseExists output
|
84 | 76 | # run: |
|
|
90 | 82 | # if: ${{ steps.check-body.outputs.phraseExists == 'true' }}
|
91 | 83 | # run: echo "The phrase 'Hey ontobot' was found."
|
92 | 84 |
|
| 85 | + |
93 | 86 | # build:
|
94 | 87 | # needs: check
|
95 |
| -# if: needs.check.outputs.phraseExists == 'true' |
| 88 | +# if: ${{ needs.check.outputs.phraseExists == 'true' }} |
96 | 89 | # runs-on: ${{ matrix.os }}
|
97 | 90 | # container: obolibrary/odkfull:v1.4.3
|
98 | 91 | # strategy:
|
|
106 | 99 |
|
107 | 100 | # - name: Return issue number
|
108 | 101 | # id: gh-script-issue
|
109 |
| -# uses: actions/github-script@v6 |
| 102 | +# uses: actions/github-script@v7 |
110 | 103 | # with:
|
111 | 104 | # script: |
|
112 | 105 | # const issue_number = context.issue.number;
|
113 | 106 | # return issue_number;
|
114 | 107 |
|
115 | 108 | # - name: Return repository name
|
116 | 109 | # id: gh-script-repo
|
117 |
| -# uses: actions/github-script@v6 |
| 110 | +# uses: actions/github-script@v7 |
118 | 111 | # with:
|
119 | 112 | # script: |
|
120 | 113 | # const repo = context.repo.owner + "/" + context.repo.repo;
|
|
130 | 123 | # - name: Get jar & enable plugin.
|
131 | 124 | # run: |
|
132 | 125 | # mkdir -p robot-plugins
|
133 |
| -# 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 |
| 126 | +# wget https://github.com/gouttegd/kgcl-java/releases/download/kgcl-java-0.4.0/kgcl-robot-plugin-0.4.0.jar -O robot-plugins/kgcl.jar |
134 | 127 | # echo "ROBOT_PLUGINS_DIRECTORY=$(pwd)/robot-plugins/" >> "$GITHUB_ENV"
|
135 | 128 |
|
136 | 129 | # - name: Install dependencies
|
137 | 130 | # run: |
|
138 | 131 | # pip install ontobot-change-agent
|
139 | 132 |
|
140 |
| -# - name: Run ochange |
141 |
| -# id: ochange |
| 133 | +# - name: Run ochange with comment-id |
| 134 | +# if: ${{ env.comment-id != '' }} |
| 135 | +# id: ochange_with_comment |
142 | 136 | # run: |
|
143 | 137 | # ochange process-issue ${{ env.resource }} \
|
144 | 138 | # -r ${{ steps.gh-script-repo.outputs.result }} \
|
145 | 139 | # -n ${{ steps.gh-script-issue.outputs.result }} \
|
146 | 140 | # -g ${{ secrets.GH_TOKEN }} \
|
147 | 141 | # -c ${{ env.comment-id }}
|
148 |
| -# # ! OR using standalone JAR file. |
149 |
| -# # ! ochange process-issue ${{ env.resource }} \ |
150 |
| -# # ! -r ${{ steps.gh-script-repo.outputs.result }} \ |
151 |
| -# # ! -n ${{ steps.gh-script-issue.outputs.result }} \ |
152 |
| -# # ! -g ${{ secrets.GH_TOKEN }} \ |
153 |
| -# # ! -p ${{ env.comment-id }} \ |
154 |
| -# # ! -j kgcl-robot.jar |
| 142 | + |
| 143 | +# - name: Run ochange without comment-id |
| 144 | +# if: ${{ env.comment-id == '' }} |
| 145 | +# id: ochange_without_comment |
| 146 | +# run: | |
| 147 | +# ochange process-issue ${{ env.resource }} \ |
| 148 | +# -r ${{ steps.gh-script-repo.outputs.result }} \ |
| 149 | +# -n ${{ steps.gh-script-issue.outputs.result }} \ |
| 150 | +# -g ${{ secrets.GH_TOKEN }} |
155 | 151 |
|
156 | 152 | # - name: Clean-up
|
157 | 153 | # run: rm -rf robot-plugins
|
|
160 | 156 | # uses: peter-evans/create-pull-request@v5
|
161 | 157 | # if: ${{ env.PR_TITLE }}
|
162 | 158 | # with:
|
163 |
| -# token: ${{ secrets.GH_TOKEN }} |
| 159 | +# # token: ${{ secrets.GH_TOKEN }} |
164 | 160 | # branch-suffix: short-commit-hash
|
165 | 161 | # labels: Automated
|
166 | 162 | # author: ${{ env.ISSUE_CREATOR }} <${{ env.ISSUE_CREATOR }}@users.noreply.github.com>
|
|
0 commit comments