Skip to content

Commit 1055391

Browse files
committed
misplaced "
1 parent 6a786f5 commit 1055391

File tree

2 files changed

+43
-14
lines changed

2 files changed

+43
-14
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
# id: vars
8181
# run: |
8282
# echo "resource=src/envo/envo-edit.owl" >> $GITHUB_ENV
83-
# echo "branch-name=kgcl_automation_${{ steps.gh-script-issue.outputs.result }}" >> $GITHUB_ENV
83+
# echo "branch-name=kgcl_automation_"${{ steps.gh-script-issue.outputs.result }} >> $GITHUB_ENV
8484
# echo "comment-id=${{ needs.check.outputs.commentId }}" >> $GITHUB_ENV
8585

8686
# - name: Get jar & enable plugin.

.github/workflows/new-pr.yml

+42-13
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
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:
17-
# - name: Check if issue body or any comment contains 'Hey ontobot'
17+
# - name: Check if issue body contains 'Hey ontobot'
1818
# id: check-body
1919
# uses: actions/github-script@v6
2020
# with:
@@ -24,7 +24,6 @@
2424
# repo: context.repo.repo,
2525
# issue_number: context.issue.number
2626
# });
27-
2827
# let bodyText = issue.data.body ? issue.data.body.toLowerCase() : '';
2928
# let commentId = null;
3029

@@ -35,18 +34,48 @@
3534
# issue_number: context.issue.number
3635
# });
3736

38-
# // Check each comment for the phrase
39-
# for (const comment of comments.data) {
40-
# if (comment.body.toLowerCase().includes('hey ontobot')) {
41-
# bodyText += ' ' + comment.body.toLowerCase();
42-
# commentId = comment.id;
37+
# // Function to check for the phrase in bodyText and comments
38+
# function checkForPhrase(bodyText, comments) {
39+
# const phrase = 'hey ontobot';
40+
41+
# // Check if bodyText includes the phrase
42+
# let result = bodyText.includes(phrase);
43+
44+
# // If not found in bodyText, check each comment
45+
# if (!result) {
46+
# for (let comment of comments) {
47+
# if (comment.body.toLowerCase().includes(phrase)) {
48+
# result = true;
49+
# commentId = comment.id;
50+
# break;
51+
# }
52+
# }
4353
# }
54+
55+
# return {
56+
# result: result,
57+
# commentId: result ? commentId : null
58+
# };
4459
# }
4560

46-
# return {
47-
# result: bodyText.includes('hey ontobot'),
48-
# commentId: commentId
49-
# };
61+
# const checkResult = checkForPhrase(bodyText, comments.data);
62+
63+
# console.log(`Result: ${checkResult.result}`);
64+
# console.log(`Comment ID: ${checkResult.commentId}`);
65+
# console.log(`Check Result: ${JSON.stringify(checkResult)}`);
66+
67+
# core.setOutput('phraseExists', checkResult.result);
68+
# core.setOutput('commentId', checkResult.commentId);
69+
70+
# - name: Log phraseExists output
71+
# run: |
72+
# echo "phraseExists: ${{ steps.check-body.outputs.phraseExists }}"
73+
# echo "commentId: ${{ steps.check-body.outputs.commentId }}"
74+
# echo "Outputs: $(echo '${{ toJSON(steps.check-body.outputs) }}')"
75+
76+
# - name: Conditional step based on result
77+
# if: ${{ steps.check-body.outputs.phraseExists == 'true' }}
78+
# run: echo "The phrase 'Hey ontobot' was found."
5079

5180
# build:
5281
# needs: check
@@ -84,7 +113,7 @@
84113
# id: vars
85114
# run: |
86115
# echo "resource=src/ontology/mondo-edit.obo" >> $GITHUB_ENV
87-
# echo "branch-name=ochange_automation_${{ steps.gh-script-issue.outputs.result }}" >> $GITHUB_ENV
116+
# echo "branch-name=ochange_automation_"${{ steps.gh-script-issue.outputs.result }} >> $GITHUB_ENV
88117

89118
# - name: Install dependencies
90119
# run: |

0 commit comments

Comments
 (0)