@@ -2,95 +2,94 @@ name: AI Release Notes
2
2
description : Generate AI release notes using git and openai, outputs 'RELEASE_NOTES' and 'OPENAI_PROMPT'
3
3
4
4
inputs :
5
- OPENAI_API_KEY :
6
- required : true
7
- type : string
8
- GHA_PAT :
9
- required : true
10
- type : string
11
- model_name :
12
- required : false
13
- type : string
14
- default : gpt-4o-mini
15
- repo_path :
16
- required : false
17
- type : string
18
- custom_prompt :
19
- required : false # knip:
20
- # runs-on: ubuntu-latest
21
- # steps:
22
- # - name: Checkout code
23
- # uses: actions/checkout@v4
24
- # - name: Setup Node.js
25
- # uses: actions/setup-node@v4
26
- # with:
27
- # node-version: '18'
28
- # cache: 'npm'
29
- # - name: Install dependencies
30
- # run: npm run install:ci
31
- # - name: Run knip checks
32
- # run: npm run knip
33
- default : ' '
34
- type : string
35
- git_ref :
36
- required : true
37
- type : string
38
- head_ref :
39
- required : true
40
- type : string
41
- base_ref :
42
- required : true
43
- type : string
5
+ OPENAI_API_KEY :
6
+ required : true
7
+ type : string
8
+ GHA_PAT :
9
+ required : true
10
+ type : string
11
+ model_name :
12
+ required : false
13
+ type : string
14
+ default : gpt-4o-mini
15
+ repo_path :
16
+ required : false
17
+ type : string
18
+ custom_prompt :
19
+ required : false # knip:
20
+ # runs-on: ubuntu-latest
21
+ # steps:
22
+ # - name: Checkout code
23
+ # uses: actions/checkout@v4
24
+ # - name: Setup Node.js
25
+ # uses: actions/setup-node@v4
26
+ # with:
27
+ # node-version: '18'
28
+ # cache: 'npm'
29
+ # - name: Install dependencies
30
+ # run: npm run install:all
31
+ # - name: Run knip checks
32
+ # run: npm run knip
33
+ default : " "
34
+ type : string
35
+ git_ref :
36
+ required : true
37
+ type : string
38
+ head_ref :
39
+ required : true
40
+ type : string
41
+ base_ref :
42
+ required : true
43
+ type : string
44
44
45
45
outputs :
46
- RELEASE_NOTES :
47
- description : " AI generated release notes"
48
- value : ${{ steps.ai_release_notes.outputs.RELEASE_NOTES }}
49
- OPENAI_PROMPT :
50
- description : " Prompt used to generate release notes"
51
- value : ${{ steps.ai_prompt.outputs.OPENAI_PROMPT }}
46
+ RELEASE_NOTES :
47
+ description : " AI generated release notes"
48
+ value : ${{ steps.ai_release_notes.outputs.RELEASE_NOTES }}
49
+ OPENAI_PROMPT :
50
+ description : " Prompt used to generate release notes"
51
+ value : ${{ steps.ai_prompt.outputs.OPENAI_PROMPT }}
52
52
53
53
env :
54
- GITHUB_REF : ${{ inputs.git_ref }}
55
- BASE_REF : ${{ inputs.base_ref }}
56
- HEAD_REF : ${{ inputs.head_ref }}
54
+ GITHUB_REF : ${{ inputs.git_ref }}
55
+ BASE_REF : ${{ inputs.base_ref }}
56
+ HEAD_REF : ${{ inputs.head_ref }}
57
57
58
58
runs :
59
- using : " composite"
60
- steps :
61
- - uses : actions/checkout@v4
62
- with :
63
- repository : ${{ inputs.repo_path }}
64
- token : ${{ inputs.GHA_PAT }}
65
- ref : ${{ env.GITHUB_REF }}
66
- fetch-depth : 0
59
+ using : " composite"
60
+ steps :
61
+ - uses : actions/checkout@v4
62
+ with :
63
+ repository : ${{ inputs.repo_path }}
64
+ token : ${{ inputs.GHA_PAT }}
65
+ ref : ${{ env.GITHUB_REF }}
66
+ fetch-depth : 0
67
67
68
- - name : Set Workspace
69
- shell : bash
70
- run : |
71
- pip install tiktoken
72
- pip install pytz
68
+ - name : Set Workspace
69
+ shell : bash
70
+ run : |
71
+ pip install tiktoken
72
+ pip install pytz
73
73
74
- # Github outputs: 'OPENAI_PROMPT'
75
- - name : Add Git Info to base prompt
76
- id : ai_prompt
77
- shell : bash
78
- env :
79
- BASE_REF : ${{ env.BASE_REF }}
80
- HEAD_SHA : ${{ env.HEAD_SHA }}
81
- PR_TITLE : ${{ github.event.pull_request.title }}
82
- PR_BODY : ${{ github.event.pull_request.body }}
83
- MODEL_NAME : ${{ inputs.model_name }}
84
- CUSTOM_PROMPT : ${{ inputs.custom_prompt }} # Default: ''
85
- run : python .github/scripts/release-notes-prompt.py
86
-
87
- # Github outputs: 'RELEASE_NOTES'
88
- - name : Generate AI release notes
89
- id : ai_release_notes
90
- shell : bash
91
- env :
92
- OPENAI_API_KEY : ${{ inputs.OPENAI_API_KEY }}
93
- CUSTOM_PROMPT : ${{ steps.ai_prompt.outputs.OPENAI_PROMPT }}
94
- MODEL_NAME : ${{ inputs.model_name }}
95
- run : python .github/scripts/ai-release-notes.py
74
+ # Github outputs: 'OPENAI_PROMPT'
75
+ - name : Add Git Info to base prompt
76
+ id : ai_prompt
77
+ shell : bash
78
+ env :
79
+ BASE_REF : ${{ env.BASE_REF }}
80
+ HEAD_SHA : ${{ env.HEAD_SHA }}
81
+ PR_TITLE : ${{ github.event.pull_request.title }}
82
+ PR_BODY : ${{ github.event.pull_request.body }}
83
+ MODEL_NAME : ${{ inputs.model_name }}
84
+ CUSTOM_PROMPT : ${{ inputs.custom_prompt }} # Default: ''
85
+ run : python .github/scripts/release-notes-prompt.py
96
86
87
+ # Github outputs: 'RELEASE_NOTES'
88
+ - name : Generate AI release notes
89
+ id : ai_release_notes
90
+ shell : bash
91
+ env :
92
+ OPENAI_API_KEY : ${{ inputs.OPENAI_API_KEY }}
93
+ CUSTOM_PROMPT : ${{ steps.ai_prompt.outputs.OPENAI_PROMPT }}
94
+ MODEL_NAME : ${{ inputs.model_name }}
95
+ run : python .github/scripts/ai-release-notes.py
0 commit comments