From 27186ca8083b5858e4d6febd9e10b82ceba06f04 Mon Sep 17 00:00:00 2001 From: skoryk-oleksandr Date: Fri, 13 Feb 2026 14:40:59 -0800 Subject: [PATCH 1/3] Added cali bot trigger --- .github/workflows/cali-bot-trigger.yml | 55 ++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .github/workflows/cali-bot-trigger.yml diff --git a/.github/workflows/cali-bot-trigger.yml b/.github/workflows/cali-bot-trigger.yml new file mode 100644 index 00000000000..6c1dd716b6d --- /dev/null +++ b/.github/workflows/cali-bot-trigger.yml @@ -0,0 +1,55 @@ +name: Trigger Cali Bot + +on: + issues: + types: [opened] + issue_comment: + types: [created] + +jobs: + trigger-cali-bot: + runs-on: ubuntu-latest + + # Ignore PR comments (we only want issues) + if: > + (github.event_name == 'issues') || + (github.event_name == 'issue_comment' && github.event.issue.pull_request == null) + + steps: + - name: Print debug info + run: | + echo "Event: ${{ github.event_name }}" + echo "Issue number: ${{ github.event.issue.number }}" + echo "Comment ID: ${{ github.event.comment.id }}" + echo "Author: ${{ github.event.comment.user.login }}" + + - name: Trigger Cali Bot + run: | + EVENT_TYPE="" + COMMENT_ID="" + COMMENT_AUTHOR="" + + if [ "${{ github.event_name }}" = "issues" ]; then + EVENT_TYPE="issue_opened" + else + EVENT_TYPE="comment_created" + COMMENT_ID="${{ github.event.comment.id }}" + COMMENT_AUTHOR="${{ github.event.comment.user.login }}" + fi + + curl -X POST \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer ${{ secrets.CALI_BOT_PAT }}" \ + https://api.github.com/repos/tigera/cali-bot/actions/workflows/process-issue.yml/dispatches \ + -d @- < Date: Fri, 13 Feb 2026 15:14:49 -0800 Subject: [PATCH 2/3] code review fixes --- .github/workflows/cali-bot-trigger.yml | 29 ++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cali-bot-trigger.yml b/.github/workflows/cali-bot-trigger.yml index 6c1dd716b6d..1e868ac8977 100644 --- a/.github/workflows/cali-bot-trigger.yml +++ b/.github/workflows/cali-bot-trigger.yml @@ -6,14 +6,22 @@ on: issue_comment: types: [created] +permissions: + contents: read + issues: read + jobs: trigger-cali-bot: runs-on: ubuntu-latest - # Ignore PR comments (we only want issues) + # Ignore PR comments and bot comments if: > (github.event_name == 'issues') || - (github.event_name == 'issue_comment' && github.event.issue.pull_request == null) + ( + github.event_name == 'issue_comment' && + github.event.issue.pull_request == null && + github.event.comment.user.type != 'Bot' + ) steps: - name: Print debug info @@ -24,7 +32,16 @@ jobs: echo "Author: ${{ github.event.comment.user.login }}" - name: Trigger Cali Bot + env: + CALI_BOT_PAT: ${{ secrets.CALI_BOT_PAT }} run: | + set -euo pipefail + + if [ -z "$CALI_BOT_PAT" ]; then + echo "CALI_BOT_PAT is not set" + exit 1 + fi + EVENT_TYPE="" COMMENT_ID="" COMMENT_AUTHOR="" @@ -37,9 +54,11 @@ jobs: COMMENT_AUTHOR="${{ github.event.comment.user.login }}" fi - curl -X POST \ + echo "Dispatching Cali Bot with event: $EVENT_TYPE" + + curl --fail --show-error --silent -X POST \ -H "Accept: application/vnd.github+json" \ - -H "Authorization: Bearer ${{ secrets.CALI_BOT_PAT }}" \ + -H "Authorization: Bearer $CALI_BOT_PAT" \ https://api.github.com/repos/tigera/cali-bot/actions/workflows/process-issue.yml/dispatches \ -d @- < Date: Mon, 2 Mar 2026 18:45:12 -0800 Subject: [PATCH 3/3] Rename cali-bot-trigger.yml to calico-github-issues-bot-trigger.yml --- ...rigger.yml => calico-github-issues-bot-trigger.yml} | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) rename .github/workflows/{cali-bot-trigger.yml => calico-github-issues-bot-trigger.yml} (88%) diff --git a/.github/workflows/cali-bot-trigger.yml b/.github/workflows/calico-github-issues-bot-trigger.yml similarity index 88% rename from .github/workflows/cali-bot-trigger.yml rename to .github/workflows/calico-github-issues-bot-trigger.yml index 1e868ac8977..058b9fe085f 100644 --- a/.github/workflows/cali-bot-trigger.yml +++ b/.github/workflows/calico-github-issues-bot-trigger.yml @@ -1,4 +1,4 @@ -name: Trigger Cali Bot +name: Trigger Calico Github Issues Bot on: issues: @@ -11,7 +11,7 @@ permissions: issues: read jobs: - trigger-cali-bot: + trigger-calico-github-issues-bot: runs-on: ubuntu-latest # Ignore PR comments and bot comments @@ -31,7 +31,7 @@ jobs: echo "Comment ID: ${{ github.event.comment.id }}" echo "Author: ${{ github.event.comment.user.login }}" - - name: Trigger Cali Bot + - name: Trigger Calico Github Issues Bot env: CALI_BOT_PAT: ${{ secrets.CALI_BOT_PAT }} run: | @@ -54,7 +54,7 @@ jobs: COMMENT_AUTHOR="${{ github.event.comment.user.login }}" fi - echo "Dispatching Cali Bot with event: $EVENT_TYPE" + echo "Dispatching Calico Github Issues Bot with event: $EVENT_TYPE" curl --fail --show-error --silent -X POST \ -H "Accept: application/vnd.github+json" \ @@ -73,4 +73,4 @@ jobs: } EOF - echo "Cali Bot dispatch successful" + echo "Calico Github Issues Bot dispatch successful"