From cd043128fec206a1cf365601e714c29186424fa5 Mon Sep 17 00:00:00 2001 From: inigo Date: Fri, 5 Sep 2025 15:17:17 -0700 Subject: [PATCH] Update workflow --- .github/workflows/issue-notify.yml | 39 --------------------- .github/workflows/issue-opened-dispatch.yml | 28 +++++++++++++++ 2 files changed, 28 insertions(+), 39 deletions(-) delete mode 100644 .github/workflows/issue-notify.yml create mode 100644 .github/workflows/issue-opened-dispatch.yml diff --git a/.github/workflows/issue-notify.yml b/.github/workflows/issue-notify.yml deleted file mode 100644 index e0351cec..00000000 --- a/.github/workflows/issue-notify.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: Issue Notification - -on: - issues: - types: [opened] - -permissions: - issues: read - actions: write - -jobs: - notify: - runs-on: ubuntu-latest - timeout-minutes: 5 - steps: - - name: Process new issue - env: - ISSUE_URL: ${{ github.event.issue.html_url }} - ISSUE_NUMBER: ${{ github.event.issue.number }} - ISSUE_TITLE: ${{ github.event.issue.title }} - TARGET_REPO: ${{ secrets.ISSUE_NOTIFY_TARGET_REPO }} - TARGET_WORKFLOW: ${{ secrets.ISSUE_NOTIFY_TARGET_WORKFLOW }} - GH_TOKEN: ${{ secrets.ISSUE_NOTIFY_TOKEN }} - run: | - # Check if internal processing is configured - if [ -z "$TARGET_REPO" ] || [ -z "$TARGET_WORKFLOW" ]; then - echo "Not configured" - exit 0 - fi - - echo "Processing issue #${ISSUE_NUMBER}" - - # Trigger internal workflow via repository_dispatch - gh api repos/${TARGET_REPO}/dispatches \ - -f event_type=issue_opened \ - -f client_payload[issue_url]="${ISSUE_URL}"|| { - echo "Issue notification sent" - exit 0 - } diff --git a/.github/workflows/issue-opened-dispatch.yml b/.github/workflows/issue-opened-dispatch.yml new file mode 100644 index 00000000..39d27ea0 --- /dev/null +++ b/.github/workflows/issue-opened-dispatch.yml @@ -0,0 +1,28 @@ +name: Issue Opened Dispatch + +on: + issues: + types: [opened] + +permissions: + issues: read + actions: write + +jobs: + notify: + runs-on: ubuntu-latest + timeout-minutes: 1 + steps: + - name: Process new issue + env: + ISSUE_URL: ${{ github.event.issue.html_url }} + ISSUE_NUMBER: ${{ github.event.issue.number }} + ISSUE_TITLE: ${{ github.event.issue.title }} + TARGET_REPO: ${{ secrets.ISSUE_OPENED_DISPATCH_TARGET_REPO }} + GH_TOKEN: ${{ secrets.ISSUE_OPENED_DISPATCH_TOKEN }} + run: | + gh api repos/${TARGET_REPO}/dispatches \ + -f event_type=issue_opened \ + -f client_payload[issue_url]="${ISSUE_URL}" || { + exit 0 + }