Skip to content

Commit

Permalink
Preliminary check for ontobot workflow (#3121)
Browse files Browse the repository at this point in the history
* Preliminary check for ontobot workflow

* Added missing line

* Undo previous commit
  • Loading branch information
hrshdhgd authored Dec 6, 2023
1 parent b8439a8 commit e059504
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/auto-pr-ontobot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,30 @@ on:
types: [ opened, edited ]

jobs:
check:
runs-on: ubuntu-latest
outputs:
phraseExists: ${{ steps.check-body.outputs.result }}
steps:
- name: Check if issue body contains 'Hey ontobot'
id: check-body
uses: actions/github-script@v6
with:
script: |
const issue = await github.rest.issues.get({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number
});
if (!issue.data.body) {
console.log('Issue body is empty or null');
return false;
}
return issue.data.body.toLowerCase().includes('hey ontobot');
build:
needs: check
if: needs.check.outputs.phraseExists == 'true'
runs-on: ${{ matrix.os }}
strategy:
matrix:
Expand Down

0 comments on commit e059504

Please sign in to comment.