Skip to content

Commit ece63f2

Browse files
committed
Updated Java pr generator
1 parent c49c1c6 commit ece63f2

File tree

1 file changed

+29
-33
lines changed

1 file changed

+29
-33
lines changed

.github/workflows/new-pr-java.yml

+29-33
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
# check:
1212
# runs-on: ubuntu-latest
1313
# outputs:
14-
# phraseExists: ${{ steps.check-body.outputs.result }}
14+
# phraseExists: ${{ steps.check-body.outputs.phraseExists }}
1515
# commentId: ${{ steps.check-body.outputs.commentId }}
1616
# steps:
1717
# - name: Check if issue body or any comment contains 'Hey ontobot'
1818
# id: check-body
19-
# uses: actions/github-script@v6
19+
# uses: actions/github-script@v7
2020
# with:
2121
# script: |
2222
# const issue = await github.rest.issues.get({
@@ -53,32 +53,24 @@
5353

5454
# return result;
5555
# }
56-
57-
# // Check each comment
5856

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')) {
6161
# result = true;
6262
# commentId = comment.id;
6363
# break;
64-
# }
65-
# }
66-
67-
68-
# return {
69-
# result: result,
70-
# commentId: result ? commentId : null
71-
# };
64+
# }
7265
# }
7366

7467
# const checkResult = checkForPhrase(bodyText, comments.data);
7568

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}`);
7971

80-
# core.setOutput('phraseExists', checkResult.result);
81-
# core.setOutput('commentId', checkResult.commentId);
72+
# core.setOutput('phraseExists', checkResult);
73+
# core.setOutput('commentId', commentId);
8274

8375
# - name: Log phraseExists output
8476
# run: |
@@ -90,9 +82,10 @@
9082
# if: ${{ steps.check-body.outputs.phraseExists == 'true' }}
9183
# run: echo "The phrase 'Hey ontobot' was found."
9284

85+
9386
# build:
9487
# needs: check
95-
# if: needs.check.outputs.phraseExists == 'true'
88+
# if: ${{ needs.check.outputs.phraseExists == 'true' }}
9689
# runs-on: ${{ matrix.os }}
9790
# container: obolibrary/odkfull:v1.4.3
9891
# strategy:
@@ -106,15 +99,15 @@
10699

107100
# - name: Return issue number
108101
# id: gh-script-issue
109-
# uses: actions/github-script@v6
102+
# uses: actions/github-script@v7
110103
# with:
111104
# script: |
112105
# const issue_number = context.issue.number;
113106
# return issue_number;
114107

115108
# - name: Return repository name
116109
# id: gh-script-repo
117-
# uses: actions/github-script@v6
110+
# uses: actions/github-script@v7
118111
# with:
119112
# script: |
120113
# const repo = context.repo.owner + "/" + context.repo.repo;
@@ -130,28 +123,31 @@
130123
# - name: Get jar & enable plugin.
131124
# run: |
132125
# 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
134127
# echo "ROBOT_PLUGINS_DIRECTORY=$(pwd)/robot-plugins/" >> "$GITHUB_ENV"
135128

136129
# - name: Install dependencies
137130
# run: |
138131
# pip install ontobot-change-agent
139132

140-
# - name: Run ochange
141-
# id: ochange
133+
# - name: Run ochange with comment-id
134+
# if: ${{ env.comment-id != '' }}
135+
# id: ochange_with_comment
142136
# run: |
143137
# ochange process-issue ${{ env.resource }} \
144138
# -r ${{ steps.gh-script-repo.outputs.result }} \
145139
# -n ${{ steps.gh-script-issue.outputs.result }} \
146140
# -g ${{ secrets.GH_TOKEN }} \
147141
# -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 }}
155151

156152
# - name: Clean-up
157153
# run: rm -rf robot-plugins
@@ -160,7 +156,7 @@
160156
# uses: peter-evans/create-pull-request@v5
161157
# if: ${{ env.PR_TITLE }}
162158
# with:
163-
# token: ${{ secrets.GH_TOKEN }}
159+
# # token: ${{ secrets.GH_TOKEN }}
164160
# branch-suffix: short-commit-hash
165161
# labels: Automated
166162
# author: ${{ env.ISSUE_CREATOR }} <${{ env.ISSUE_CREATOR }}@users.noreply.github.com>

0 commit comments

Comments
 (0)