Skip to content

Commit

Permalink
misplaced "
Browse files Browse the repository at this point in the history
  • Loading branch information
hrshdhgd committed Jun 26, 2024
1 parent 6a786f5 commit 1055391
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/new-pr-java.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
# id: vars
# run: |
# echo "resource=src/envo/envo-edit.owl" >> $GITHUB_ENV
# echo "branch-name=kgcl_automation_${{ steps.gh-script-issue.outputs.result }}" >> $GITHUB_ENV
# echo "branch-name=kgcl_automation_"${{ steps.gh-script-issue.outputs.result }} >> $GITHUB_ENV
# echo "comment-id=${{ needs.check.outputs.commentId }}" >> $GITHUB_ENV

# - name: Get jar & enable plugin.
Expand Down
55 changes: 42 additions & 13 deletions .github/workflows/new-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
# check:
# runs-on: ubuntu-latest
# outputs:
# phraseExists: ${{ steps.check-body.outputs.result }}
# phraseExists: ${{ steps.check-body.outputs.phraseExists }}
# commentId: ${{ steps.check-body.outputs.commentId }}
# steps:
# - name: Check if issue body or any comment contains 'Hey ontobot'
# - name: Check if issue body contains 'Hey ontobot'
# id: check-body
# uses: actions/github-script@v6
# with:
Expand All @@ -24,7 +24,6 @@
# repo: context.repo.repo,
# issue_number: context.issue.number
# });

# let bodyText = issue.data.body ? issue.data.body.toLowerCase() : '';
# let commentId = null;

Expand All @@ -35,18 +34,48 @@
# issue_number: context.issue.number
# });

# // Check each comment for the phrase
# for (const comment of comments.data) {
# if (comment.body.toLowerCase().includes('hey ontobot')) {
# bodyText += ' ' + comment.body.toLowerCase();
# commentId = comment.id;
# // Function to check for the phrase in bodyText and comments
# function checkForPhrase(bodyText, comments) {
# const phrase = 'hey ontobot';

# // Check if bodyText includes the phrase
# let result = bodyText.includes(phrase);

# // If not found in bodyText, check each comment
# if (!result) {
# for (let comment of comments) {
# if (comment.body.toLowerCase().includes(phrase)) {
# result = true;
# commentId = comment.id;
# break;
# }
# }
# }

# return {
# result: result,
# commentId: result ? commentId : null
# };
# }

# return {
# result: bodyText.includes('hey ontobot'),
# commentId: commentId
# };
# const checkResult = checkForPhrase(bodyText, comments.data);

# console.log(`Result: ${checkResult.result}`);
# console.log(`Comment ID: ${checkResult.commentId}`);
# console.log(`Check Result: ${JSON.stringify(checkResult)}`);

# core.setOutput('phraseExists', checkResult.result);
# core.setOutput('commentId', checkResult.commentId);

# - name: Log phraseExists output
# run: |
# echo "phraseExists: ${{ steps.check-body.outputs.phraseExists }}"
# echo "commentId: ${{ steps.check-body.outputs.commentId }}"
# echo "Outputs: $(echo '${{ toJSON(steps.check-body.outputs) }}')"

# - name: Conditional step based on result
# if: ${{ steps.check-body.outputs.phraseExists == 'true' }}
# run: echo "The phrase 'Hey ontobot' was found."

# build:
# needs: check
Expand Down Expand Up @@ -84,7 +113,7 @@
# id: vars
# run: |
# echo "resource=src/ontology/mondo-edit.obo" >> $GITHUB_ENV
# echo "branch-name=ochange_automation_${{ steps.gh-script-issue.outputs.result }}" >> $GITHUB_ENV
# echo "branch-name=ochange_automation_"${{ steps.gh-script-issue.outputs.result }} >> $GITHUB_ENV

# - name: Install dependencies
# run: |
Expand Down

0 comments on commit 1055391

Please sign in to comment.