Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/workflows/jf-gha-caller.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: jf-gha-caller.yml
on:
pull_request:
types: [opened, edited, synchronize]

jobs:
call-callee:
uses: ./.github/workflows/jf-gha-exp-callee.yml
with:
pr_number: ${{ github.event.pull_request.number }}
35 changes: 35 additions & 0 deletions .github/workflows/jf-gha-exp-callee.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: jf-gha-exp.yml
on:
workflow_call:
inputs:
pr_number:
description: The number of the pull request to operate on
required: true
type: number

jobs:
read-comments:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Add a comment to the PR
uses: actions/github-script@v7
env:
PR_NUMBER: ${{ inputs.pr_number }}
with:
script: |
const comments = await github.paginate(github.rest.issues.listComments, {
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: Number(process.env.PR_NUMBER)
});
console.log(`COMMENT COUNT IS ${comments.length}`);
const filterFn = (comment) => {
return comment.user.type === "Bot"
&& comment.body === "Comment added by a machine! Beep boop!"
&& comment.reactions.eyes > 0
};
const commentsAcknowledgedByUser = comments.filter(filterFn);
console.log(`NUMBER OF FILTER COMMENTS IS ${commentsAcknowledgedByUser.length}`);
console.log(JSON.stringify(commentsAcknowledgedByUser, null, 2));
Loading