Update check-for-integration-result.yml #1
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Check for integration result | |
on: | |
issue_comment: | |
types: [created, edited, deleted] | |
push: # for debugging | |
jobs: | |
# fetch comments, if integration-test comment is present, use that to label pass or fail. remove in-progress. | |
check-for-integration-result: | |
if: ${{ github.event.issue.pull_request }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Get integration result comment | |
uses: actions/github-script@v7 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
script: | | |
const result = await github.rest.issues.listComments({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo | |
}); | |
console.log(result) | |
const integrationComments = result.data.filter(c => c.user.login == 'primer-integration[bot]' && c.body.includes('test-result)) | |
console.log(integrationComments) | |
const latestComment = integrationComments.sort(c => c.createdAt)[0] | |
if (latestComment) { | |
// add label | |
} |