Skip to content

debug github.event

debug github.event #2

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: debug event
run: 'echo ${{ github.event }}'
- 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
}