Skip to content

Commit 03e4717

Browse files
[docs] Updated changelog workflow docs #653
Closes #653
1 parent 839c5c6 commit 03e4717

1 file changed

Lines changed: 22 additions & 11 deletions

File tree

docs/developer/reusable-github-utils.rst

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -491,10 +491,15 @@ to secrets, and is the one that generates and posts the changelog comment.
491491
To enable the changelog bot in any OpenWISP repository, create the
492492
following two workflow files.
493493

494-
**1. Trigger** (``.github/workflows/bot-changelog-trigger.yml``)
494+
To enable the changelog bot in any OpenWISP repository, create the
495+
following two workflow files under ``.github/workflows/``.
496+
497+
The trigger workflow runs when a PR review is submitted. If the PR is
498+
approved by a maintainer and its title starts with ``[feature]``,
499+
``[fix]``, or ``[change]``, it stores the PR number as workflow metadata.
495500

496-
This workflow fires on PR approval, checks if the PR is noteworthy, and
497-
uploads the PR number as an artifact for the runner to pick up.
501+
**1. Changelog Bot Trigger**
502+
(``.github/workflows/bot-changelog-trigger.yml``)
498503

499504
.. code-block:: yaml
500505
@@ -504,6 +509,8 @@ uploads the PR number as an artifact for the runner to pick up.
504509
pull_request_review:
505510
types: [submitted]
506511
512+
permissions: {}
513+
507514
jobs:
508515
check:
509516
if: |
@@ -530,15 +537,16 @@ uploads the PR number as an artifact for the runner to pick up.
530537
531538
- name: Upload PR metadata
532539
if: steps.check.outputs.has_noteworthy == 'true'
533-
uses: actions/upload-artifact@v4
540+
uses: actions/upload-artifact@v7
534541
with:
535542
name: changelog-metadata
536543
path: pr_number
537544
538-
**2. Runner** (``.github/workflows/bot-changelog-runner.yml``)
545+
The runner workflow is triggered after the trigger workflow completes. It
546+
retrieves the PR metadata and calls the reusable changelog workflow.
539547

540-
This workflow triggers after the trigger completes, downloads the
541-
artifact, and calls the reusable workflow with full secret access.
548+
**2. Changelog Bot Runner**
549+
(``.github/workflows/bot-changelog-runner.yml``)
542550

543551
.. code-block:: yaml
544552
@@ -552,20 +560,19 @@ artifact, and calls the reusable workflow with full secret access.
552560
553561
permissions:
554562
actions: read
555-
contents: read
556-
pull-requests: write
557-
issues: write
558563
559564
jobs:
560565
fetch-metadata:
561566
runs-on: ubuntu-latest
562567
if: github.event.workflow_run.conclusion == 'success'
568+
permissions:
569+
actions: read
563570
outputs:
564571
pr_number: ${{ steps.metadata.outputs.pr_number }}
565572
steps:
566573
- name: Download PR metadata
567574
id: download
568-
uses: actions/download-artifact@v4
575+
uses: actions/download-artifact@v8
569576
with:
570577
name: changelog-metadata
571578
github-token: ${{ secrets.GITHUB_TOKEN }}
@@ -586,6 +593,10 @@ artifact, and calls the reusable workflow with full secret access.
586593
changelog:
587594
needs: fetch-metadata
588595
if: needs.fetch-metadata.outputs.pr_number != ''
596+
permissions:
597+
contents: read
598+
pull-requests: write
599+
issues: write
589600
uses: openwisp/openwisp-utils/.github/workflows/reusable-bot-changelog.yml@master
590601
with:
591602
pr_number: ${{ needs.fetch-metadata.outputs.pr_number }}

0 commit comments

Comments
 (0)