From 997d0461ae59af27ca70726271792a99388c466f Mon Sep 17 00:00:00 2001 From: Jamie Feingold Date: Wed, 26 Aug 2026 10:51:01 -0500 Subject: [PATCH 1/4] commit 1 --- .github/workflows/jf-gha-exp-callee.yml | 44 +++++++++++++++++++++++++ .github/workflows/jf-gha-exp-caller.yml | 8 +++++ 2 files changed, 52 insertions(+) create mode 100644 .github/workflows/jf-gha-exp-callee.yml create mode 100644 .github/workflows/jf-gha-exp-caller.yml diff --git a/.github/workflows/jf-gha-exp-callee.yml b/.github/workflows/jf-gha-exp-callee.yml new file mode 100644 index 0000000..22ac263 --- /dev/null +++ b/.github/workflows/jf-gha-exp-callee.yml @@ -0,0 +1,44 @@ +name: jf-gha-exp.yml +on: + workflow_call: + +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: ${{ github.event.pull_request.title }} + with: + script: | + const roboCommentBody = "This PR lacks any commits of the 'fix' or 'feat' type, and therefore will not trigger a release. To silence all further warnings, react to this warning comment (or any other) with the :eyes: emoji."; + const commits = await github.paginate(github.rest.pulls.listCommits, { + owner: context.repo.owner, + repo: context.repo.repo, + pull_number: Number(process.env.PR_NUMBER), + per_page: 100 + }); + const hasFixOrFeatCommits = commits.some(c => { + return c.commit.message.startsWith('fix') || c.commit.message.startsWith('feat'); + }); + const comments = await github.paginate(github.rest.issues.listComments, { + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: Number(process.env.PR_NUMBER) + }); + const hasAcknowledgedRoboComment = comments.some(comment => { + return comment.user.type === 'Bot' + && comment.body === roboCommentBody + && comment.reactions.eyes > 0 + }); + if (!hasFixOrFeatCommits && !hasAcknowledgedRoboComment) { + await github.rest.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: Number(process.env.PR_NUMBER), + body: roboCommentBody + }); + } diff --git a/.github/workflows/jf-gha-exp-caller.yml b/.github/workflows/jf-gha-exp-caller.yml new file mode 100644 index 0000000..1592e36 --- /dev/null +++ b/.github/workflows/jf-gha-exp-caller.yml @@ -0,0 +1,8 @@ +name: jf-gha-caller.yml +on: + pull_request: + types: [opened, edited, synchronize] + +jobs: + call-callee: + uses: ./.github/workflows/jf-gha-exp-callee.yml From a142cc1af17dbdfd2b207442ca500d2062645cc7 Mon Sep 17 00:00:00 2001 From: Jamie Feingold Date: Fri, 28 Aug 2026 12:27:09 -0500 Subject: [PATCH 2/4] commit 2 --- .github/workflows/jf-gha-exp-callee.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/jf-gha-exp-callee.yml b/.github/workflows/jf-gha-exp-callee.yml index 22ac263..54f88f2 100644 --- a/.github/workflows/jf-gha-exp-callee.yml +++ b/.github/workflows/jf-gha-exp-callee.yml @@ -8,6 +8,16 @@ jobs: permissions: pull-requests: write steps: + - name: check merge settings + env: + GH_TOKEN: ${{ github.token }} + run: | + squash=$(gh api "repos/${{ github.repository }}" --jq '.allow_squash_merge') + echo "Squash merge enabled: $squash" + if [ "$squash" = "true" ]; then + echo "SQUASH IS ENABLED" + echo "squash_enabled=true" >> "$GITHUB_OUTPUT" + fi - name: Add a comment to the PR uses: actions/github-script@v7 env: From 90e3e7f71491c7870489e9df45b0e08eeb4fb3b4 Mon Sep 17 00:00:00 2001 From: Jamie Feingold Date: Fri, 28 Aug 2026 12:29:57 -0500 Subject: [PATCH 3/4] commit 3 --- .github/workflows/jf-gha-exp-callee.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/jf-gha-exp-callee.yml b/.github/workflows/jf-gha-exp-callee.yml index 54f88f2..5484d93 100644 --- a/.github/workflows/jf-gha-exp-callee.yml +++ b/.github/workflows/jf-gha-exp-callee.yml @@ -21,9 +21,16 @@ jobs: - name: Add a comment to the PR uses: actions/github-script@v7 env: - PR_NUMBER: ${{ github.event.pull_request.title }} + PR_NUMBER: ${{ github.event.pull_request.number }} with: script: | + const { data: repo } = await github.rest.repos.get({ + owner: context.repo.owner, + repo: context.repo.repo, + }); + console.log(`squashing? ${repo.allow_squash_merge)}`); + core.info(`allow_squash_merge: ${repo.allow_squash_merge}`); + core.setOutput('squash_enabled', repo.allow_squash_merge); const roboCommentBody = "This PR lacks any commits of the 'fix' or 'feat' type, and therefore will not trigger a release. To silence all further warnings, react to this warning comment (or any other) with the :eyes: emoji."; const commits = await github.paginate(github.rest.pulls.listCommits, { owner: context.repo.owner, From 2d84cb87b8a05a76a3b910902cd9c9df94a48750 Mon Sep 17 00:00:00 2001 From: Jamie Feingold Date: Fri, 28 Aug 2026 12:30:50 -0500 Subject: [PATCH 4/4] commit 4 --- .github/workflows/jf-gha-exp-callee.yml | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/.github/workflows/jf-gha-exp-callee.yml b/.github/workflows/jf-gha-exp-callee.yml index 5484d93..26da7e4 100644 --- a/.github/workflows/jf-gha-exp-callee.yml +++ b/.github/workflows/jf-gha-exp-callee.yml @@ -8,16 +8,6 @@ jobs: permissions: pull-requests: write steps: - - name: check merge settings - env: - GH_TOKEN: ${{ github.token }} - run: | - squash=$(gh api "repos/${{ github.repository }}" --jq '.allow_squash_merge') - echo "Squash merge enabled: $squash" - if [ "$squash" = "true" ]; then - echo "SQUASH IS ENABLED" - echo "squash_enabled=true" >> "$GITHUB_OUTPUT" - fi - name: Add a comment to the PR uses: actions/github-script@v7 env: @@ -28,7 +18,7 @@ jobs: owner: context.repo.owner, repo: context.repo.repo, }); - console.log(`squashing? ${repo.allow_squash_merge)}`); + console.log(`squashing? ${repo.allow_squash_merge}`); core.info(`allow_squash_merge: ${repo.allow_squash_merge}`); core.setOutput('squash_enabled', repo.allow_squash_merge); const roboCommentBody = "This PR lacks any commits of the 'fix' or 'feat' type, and therefore will not trigger a release. To silence all further warnings, react to this warning comment (or any other) with the :eyes: emoji.";