From 0041ee2fd826e18cb79b9e3348a1db8e95572e3c Mon Sep 17 00:00:00 2001 From: pushpit kamboj Date: Fri, 13 Mar 2026 22:39:59 +0530 Subject: [PATCH 1/4] [CI] Add changelog bot workflow --- .github/workflows/bot-changelog.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .github/workflows/bot-changelog.yml diff --git a/.github/workflows/bot-changelog.yml b/.github/workflows/bot-changelog.yml new file mode 100644 index 000000000..6558c0a27 --- /dev/null +++ b/.github/workflows/bot-changelog.yml @@ -0,0 +1,15 @@ +name: Changelog Bot + +on: + # Trigger when a PR review is submitted with approval + pull_request_review: + types: [submitted] + +jobs: + changelog: + # Call the reusable workflow from openwisp-utils + uses: openwisp/openwisp-utils/.github/workflows/reusable-bot-changelog.yml@master + 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 }} From a6055ec35fe9a28370545659133fa2b2870d8e3c Mon Sep 17 00:00:00 2001 From: pushpit kamboj Date: Sat, 14 Mar 2026 11:12:54 +0530 Subject: [PATCH 2/4] [change] Add PR approved checks --- .github/workflows/bot-changelog.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/bot-changelog.yml b/.github/workflows/bot-changelog.yml index 6558c0a27..a09d16793 100644 --- a/.github/workflows/bot-changelog.yml +++ b/.github/workflows/bot-changelog.yml @@ -7,7 +7,11 @@ on: jobs: changelog: - # Call the reusable workflow from openwisp-utils + if: | + github.event.review.state == 'approved' && + (github.event.review.author_association == 'OWNER' || + github.event.review.author_association == 'MEMBER' || + github.event.review.author_association == 'COLLABORATOR') uses: openwisp/openwisp-utils/.github/workflows/reusable-bot-changelog.yml@master secrets: GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }} From 2be8650ee640f8d538963e36bcfa0d2cc843bcbf Mon Sep 17 00:00:00 2001 From: pushpit kamboj Date: Fri, 27 Mar 2026 11:58:59 +0530 Subject: [PATCH 3/4] [ci] Remove old workflow with new trigger and runner yml files --- .github/workflows/bot-changelog-runner.yml | 54 +++++++++++++++++++++ .github/workflows/bot-changelog-trigger.yml | 39 +++++++++++++++ .github/workflows/bot-changelog.yml | 19 -------- 3 files changed, 93 insertions(+), 19 deletions(-) create mode 100644 .github/workflows/bot-changelog-runner.yml create mode 100644 .github/workflows/bot-changelog-trigger.yml delete mode 100644 .github/workflows/bot-changelog.yml diff --git a/.github/workflows/bot-changelog-runner.yml b/.github/workflows/bot-changelog-runner.yml new file mode 100644 index 000000000..73a32d636 --- /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 000000000..b98a6a4be --- /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 diff --git a/.github/workflows/bot-changelog.yml b/.github/workflows/bot-changelog.yml deleted file mode 100644 index a09d16793..000000000 --- a/.github/workflows/bot-changelog.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: Changelog Bot - -on: - # Trigger when a PR review is submitted with approval - pull_request_review: - types: [submitted] - -jobs: - changelog: - if: | - github.event.review.state == 'approved' && - (github.event.review.author_association == 'OWNER' || - github.event.review.author_association == 'MEMBER' || - github.event.review.author_association == 'COLLABORATOR') - uses: openwisp/openwisp-utils/.github/workflows/reusable-bot-changelog.yml@master - 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 }} From b6f6572b06df71ec9656d4717aeb5282bf7e59ec Mon Sep 17 00:00:00 2001 From: pushpit kamboj Date: Fri, 27 Mar 2026 13:02:06 +0530 Subject: [PATCH 4/4] [fix] QA checks --- .github/workflows/bot-changelog-runner.yml | 2 +- .github/workflows/bot-changelog-trigger.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/bot-changelog-runner.yml b/.github/workflows/bot-changelog-runner.yml index 73a32d636..f54737eed 100644 --- a/.github/workflows/bot-changelog-runner.yml +++ b/.github/workflows/bot-changelog-runner.yml @@ -51,4 +51,4 @@ 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 }} diff --git a/.github/workflows/bot-changelog-trigger.yml b/.github/workflows/bot-changelog-trigger.yml index b98a6a4be..a41854196 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: | @@ -36,4 +36,4 @@ jobs: uses: actions/upload-artifact@v4 with: name: changelog-metadata - path: pr_number \ No newline at end of file + path: pr_number