From 81a2f8f7815b192b0ead9fb5a35f91ddea0a9653 Mon Sep 17 00:00:00 2001 From: pushpit kamboj Date: Fri, 27 Mar 2026 12:09:22 +0530 Subject: [PATCH 1/4] [ci] Add workflow for changelog bot --- .github/workflows/bot-changelog-runner.yml | 54 +++++++++++++++++++++ .github/workflows/bot-changelog-trigger.yml | 39 +++++++++++++++ 2 files changed, 93 insertions(+) create mode 100644 .github/workflows/bot-changelog-runner.yml create mode 100644 .github/workflows/bot-changelog-trigger.yml diff --git a/.github/workflows/bot-changelog-runner.yml b/.github/workflows/bot-changelog-runner.yml new file mode 100644 index 00000000..73a32d63 --- /dev/null +++ b/.github/workflows/bot-changelog-runner.yml @@ -0,0 +1,54 @@ +name: Changelog Bot Runner + +on: + workflow_run: + workflows: ["Changelog Bot Trigger"] + types: + - completed + +permissions: + actions: read + contents: read + pull-requests: write + issues: write + +env: + FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true + +jobs: + fetch-metadata: + runs-on: ubuntu-latest + if: github.event.workflow_run.conclusion == 'success' + outputs: + pr_number: ${{ steps.metadata.outputs.pr_number }} + steps: + - name: Download PR metadata + id: download + uses: actions/download-artifact@v4 + with: + name: changelog-metadata + github-token: ${{ secrets.GITHUB_TOKEN }} + run-id: ${{ github.event.workflow_run.id }} + continue-on-error: true + + - name: Read PR metadata + if: steps.download.outcome == 'success' + id: metadata + run: | + PR_NUMBER=$(cat pr_number) + if ! [[ "$PR_NUMBER" =~ ^[0-9]+$ ]]; then + echo "::error::Invalid PR number: $PR_NUMBER" + exit 1 + fi + echo "pr_number=$PR_NUMBER" >> $GITHUB_OUTPUT + + changelog: + needs: fetch-metadata + if: needs.fetch-metadata.outputs.pr_number != '' + uses: openwisp/openwisp-utils/.github/workflows/reusable-bot-changelog.yml@master + with: + pr_number: ${{ needs.fetch-metadata.outputs.pr_number }} + secrets: + GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }} + OPENWISP_BOT_APP_ID: ${{ secrets.OPENWISP_BOT_APP_ID }} + OPENWISP_BOT_PRIVATE_KEY: ${{ secrets.OPENWISP_BOT_PRIVATE_KEY }} \ No newline at end of file diff --git a/.github/workflows/bot-changelog-trigger.yml b/.github/workflows/bot-changelog-trigger.yml new file mode 100644 index 00000000..b98a6a4b --- /dev/null +++ b/.github/workflows/bot-changelog-trigger.yml @@ -0,0 +1,39 @@ +name: Changelog Bot Trigger + +on: + pull_request_review: + types: [submitted] + +env: + FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true + +jobs: + check: + if: | + github.event.review.state == 'approved' && + (github.event.review.author_association == 'OWNER' || + github.event.review.author_association == 'MEMBER' || + github.event.review.author_association == 'COLLABORATOR') + runs-on: ubuntu-latest + steps: + - name: Check for noteworthy PR + id: check + env: + PR_TITLE: ${{ github.event.pull_request.title }} + run: | + if echo "$PR_TITLE" | grep -qiE '^\[(feature|fix|change)\]'; then + echo "has_noteworthy=true" >> $GITHUB_OUTPUT + fi + + - name: Save PR metadata + if: steps.check.outputs.has_noteworthy == 'true' + env: + PR_NUMBER: ${{ github.event.pull_request.number }} + run: echo "$PR_NUMBER" > pr_number + + - name: Upload PR metadata + if: steps.check.outputs.has_noteworthy == 'true' + uses: actions/upload-artifact@v4 + with: + name: changelog-metadata + path: pr_number \ No newline at end of file From 0d29a3cd26753ec99b6a0f6ca7a3fb20c6a70eff Mon Sep 17 00:00:00 2001 From: pushpit kamboj Date: Fri, 27 Mar 2026 12:13:19 +0530 Subject: [PATCH 2/4] Chore --- .github/workflows/bot-changelog-runner.yml | 3 ++- .github/workflows/bot-changelog-trigger.yml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/bot-changelog-runner.yml b/.github/workflows/bot-changelog-runner.yml index 73a32d63..ec660bbd 100644 --- a/.github/workflows/bot-changelog-runner.yml +++ b/.github/workflows/bot-changelog-runner.yml @@ -51,4 +51,5 @@ jobs: secrets: GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }} OPENWISP_BOT_APP_ID: ${{ secrets.OPENWISP_BOT_APP_ID }} - OPENWISP_BOT_PRIVATE_KEY: ${{ secrets.OPENWISP_BOT_PRIVATE_KEY }} \ No newline at end of file + OPENWISP_BOT_PRIVATE_KEY: ${{ secrets.OPENWISP_BOT_PRIVATE_KEY }} + \ No newline at end of file diff --git a/.github/workflows/bot-changelog-trigger.yml b/.github/workflows/bot-changelog-trigger.yml index b98a6a4b..f7a3cbdf 100644 --- a/.github/workflows/bot-changelog-trigger.yml +++ b/.github/workflows/bot-changelog-trigger.yml @@ -36,4 +36,5 @@ jobs: uses: actions/upload-artifact@v4 with: name: changelog-metadata - path: pr_number \ No newline at end of file + path: pr_number + \ No newline at end of file From c6ae97abe4ea8e19582970e353d6b424aac87a41 Mon Sep 17 00:00:00 2001 From: pushpit kamboj Date: Sun, 12 Apr 2026 10:15:36 +0530 Subject: [PATCH 3/4] [fix] Qa fixed --- .github/workflows/bot-changelog-runner.yml | 1 - .github/workflows/bot-changelog-trigger.yml | 1 - 2 files changed, 2 deletions(-) diff --git a/.github/workflows/bot-changelog-runner.yml b/.github/workflows/bot-changelog-runner.yml index ec660bbd..f54737ee 100644 --- a/.github/workflows/bot-changelog-runner.yml +++ b/.github/workflows/bot-changelog-runner.yml @@ -52,4 +52,3 @@ jobs: GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }} OPENWISP_BOT_APP_ID: ${{ secrets.OPENWISP_BOT_APP_ID }} OPENWISP_BOT_PRIVATE_KEY: ${{ secrets.OPENWISP_BOT_PRIVATE_KEY }} - \ No newline at end of file diff --git a/.github/workflows/bot-changelog-trigger.yml b/.github/workflows/bot-changelog-trigger.yml index f7a3cbdf..c5738cb0 100644 --- a/.github/workflows/bot-changelog-trigger.yml +++ b/.github/workflows/bot-changelog-trigger.yml @@ -37,4 +37,3 @@ jobs: with: name: changelog-metadata path: pr_number - \ No newline at end of file From b86efd08fb3c48b13445c36ac149bdadc857d3ec Mon Sep 17 00:00:00 2001 From: pushpit kamboj Date: Sun, 12 Apr 2026 10:29:31 +0530 Subject: [PATCH 4/4] [fix] Qa fix --- .github/workflows/bot-changelog-trigger.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/bot-changelog-trigger.yml b/.github/workflows/bot-changelog-trigger.yml index c5738cb0..a4185419 100644 --- a/.github/workflows/bot-changelog-trigger.yml +++ b/.github/workflows/bot-changelog-trigger.yml @@ -6,7 +6,7 @@ on: env: FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true - + jobs: check: if: |