@@ -5,7 +5,19 @@ name: Uv export requirements
55
66on :
77 workflow_dispatch :
8-
8+ inputs :
9+ commit_message :
10+ description : " Commit message for updated requirements"
11+ required : false
12+ default : " chore: update requirements"
13+ commit_title :
14+ description : " Pull request title"
15+ required : false
16+ default : " Export requirements*.txt"
17+ commit_body :
18+ description : " Pull request body"
19+ required : false
20+ default : " Export production & development requirements"
921 # pull_request:
1022 # branches:
1123 # - main
4254 # with:
4355 # commit_message: "${{ github.event.inputs.commit_message || 'chore: update requirements' }}"
4456
45- # # Uncomment if you don't have a commit- changes workflow to call
57+ # # Commit and push changes
4658 - name : Commit and push changes
4759 env :
4860 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
@@ -52,18 +64,21 @@ jobs:
5264 if ! git diff --quiet; then
5365 echo "Changes detected. Committing..."
5466 git add requirements.txt requirements.dev.txt
55- git commit -m "${{ github.event.inputs.commit_message }}"
56- git push origin HEAD:${{ github.event.pull_request.head.ref || github.ref_name }}"
67+
68+ COMMIT_MESSAGE="${{ github.event.inputs.commit_message || 'chore: update requirements' }}"
69+ git commit -m "$COMMIT_MESSAGE"
70+
71+ git push origin HEAD:${{ github.ref_name }}
5772 else
58- echo "No changes detected. Skipping commmit ."
73+ echo "No changes detected. Skipping commit ."
5974 fi
6075
6176 # # Open new PR to main
6277 - name : Create PR for dependency updates
6378 uses : peter-evans/create-pull-request@v5
6479 with :
6580 branch : chore/bump-depends
66- commit-message : " ${{ inputs.commit_message || 'chore: export requirements' }}"
67- title : " ${{ inputs.commit_title || 'Export requirements*.txt' }}"
68- body : " ${{ inputs.commit_body || 'Export production & development requirements' }}"
69- base : main
81+ commit-message : " ${{ github.event. inputs.commit_message || 'chore: update requirements' }}"
82+ title : " ${{ github.event. inputs.commit_title || 'Update requirements*.txt files ' }}"
83+ body : " ${{ github.event. inputs.commit_body || 'Export production & dev requirements' }}"
84+ base : main
0 commit comments