File tree Expand file tree Collapse file tree 3 files changed +93
-19
lines changed
Expand file tree Collapse file tree 3 files changed +93
-19
lines changed Original file line number Diff line number Diff line change 1+ name : Changelog Bot Runner
2+
3+ on :
4+ workflow_run :
5+ workflows : ["Changelog Bot Trigger"]
6+ types :
7+ - completed
8+
9+ permissions :
10+ actions : read
11+ contents : read
12+ pull-requests : write
13+ issues : write
14+
15+ env :
16+ FORCE_JAVASCRIPT_ACTIONS_TO_NODE24 : true
17+
18+ jobs :
19+ fetch-metadata :
20+ runs-on : ubuntu-latest
21+ if : github.event.workflow_run.conclusion == 'success'
22+ outputs :
23+ pr_number : ${{ steps.metadata.outputs.pr_number }}
24+ steps :
25+ - name : Download PR metadata
26+ id : download
27+ uses : actions/download-artifact@v4
28+ with :
29+ name : changelog-metadata
30+ github-token : ${{ secrets.GITHUB_TOKEN }}
31+ run-id : ${{ github.event.workflow_run.id }}
32+ continue-on-error : true
33+
34+ - name : Read PR metadata
35+ if : steps.download.outcome == 'success'
36+ id : metadata
37+ run : |
38+ PR_NUMBER=$(cat pr_number)
39+ if ! [[ "$PR_NUMBER" =~ ^[0-9]+$ ]]; then
40+ echo "::error::Invalid PR number: $PR_NUMBER"
41+ exit 1
42+ fi
43+ echo "pr_number=$PR_NUMBER" >> $GITHUB_OUTPUT
44+
45+ changelog :
46+ needs : fetch-metadata
47+ if : needs.fetch-metadata.outputs.pr_number != ''
48+ uses : openwisp/openwisp-utils/.github/workflows/reusable-bot-changelog.yml@master
49+ with :
50+ pr_number : ${{ needs.fetch-metadata.outputs.pr_number }}
51+ secrets :
52+ GEMINI_API_KEY : ${{ secrets.GEMINI_API_KEY }}
53+ OPENWISP_BOT_APP_ID : ${{ secrets.OPENWISP_BOT_APP_ID }}
54+ OPENWISP_BOT_PRIVATE_KEY : ${{ secrets.OPENWISP_BOT_PRIVATE_KEY }}
Original file line number Diff line number Diff line change 1+ name : Changelog Bot Trigger
2+
3+ on :
4+ pull_request_review :
5+ types : [submitted]
6+
7+ env :
8+ FORCE_JAVASCRIPT_ACTIONS_TO_NODE24 : true
9+
10+ jobs :
11+ check :
12+ if : |
13+ github.event.review.state == 'approved' &&
14+ (github.event.review.author_association == 'OWNER' ||
15+ github.event.review.author_association == 'MEMBER' ||
16+ github.event.review.author_association == 'COLLABORATOR')
17+ runs-on : ubuntu-latest
18+ steps :
19+ - name : Check for noteworthy PR
20+ id : check
21+ env :
22+ PR_TITLE : ${{ github.event.pull_request.title }}
23+ run : |
24+ if echo "$PR_TITLE" | grep -qiE '^\[(feature|fix|change)\]'; then
25+ echo "has_noteworthy=true" >> $GITHUB_OUTPUT
26+ fi
27+
28+ - name : Save PR metadata
29+ if : steps.check.outputs.has_noteworthy == 'true'
30+ env :
31+ PR_NUMBER : ${{ github.event.pull_request.number }}
32+ run : echo "$PR_NUMBER" > pr_number
33+
34+ - name : Upload PR metadata
35+ if : steps.check.outputs.has_noteworthy == 'true'
36+ uses : actions/upload-artifact@v4
37+ with :
38+ name : changelog-metadata
39+ path : pr_number
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments