@@ -14,23 +14,39 @@ inputs:
14
14
runs :
15
15
using : " composite"
16
16
steps :
17
- - name : Commit and PR
18
- uses : peter-evans/create-pull-request@v5
17
+ - name : Commit to new branch
18
+ uses : EndBug/add-and-commit@v9
19
+ id : create-branch-and-commit
20
+ with :
21
+ message : ' [CI Pipeline] ${{ inputs.message }}'
22
+ author_name : Release Workflow
23
+
24
+ new_branch : ci-${{ github.sha }}
25
+ add : ${{ inputs.add }}
26
+
27
+ - name : Create PR
28
+ uses : actions/github-script@v7
19
29
id : create-pr
20
30
with :
21
- commit-message : ' [CI Pipeline] ${{ inputs.message }}'
22
- title : ' [CI Pipeline] ${{ inputs.message }}'
23
- body : ' [CI Pipeline] Automated update'
24
- branch-suffix : short-commit-hash
25
- add-paths : ${{ inputs.add }}
31
+ script : |
32
+ const newPr = (await github.rest.pulls.create({
33
+ owner: context.repo.owner,
34
+ repo: context.repo.repo,
35
+ title: '[CI Pipeline] ${{ inputs.message }}',
36
+ head: 'ci-${{ github.sha }}',
37
+ base: '${{ github.ref_name }}',
38
+ body: '[CI Pipeline] Automated update'
39
+ })).data;
40
+ core.setOutput('pull-request-url', newPr.html_url);
41
+ core.setOutput('pull-request-number', newPr.number);
26
42
27
43
- name : Merge PR
28
44
run : gh pr merge $PR_URL $MERGE_PR_STRATEGY
29
45
shell : bash
30
46
env :
31
47
GITHUB_TOKEN : ${{ github.token }}
32
48
PR_URL : ${{ steps.create-pr.outputs.pull-request-url }}
33
- MERGE_PR_STRATEGY : ${{github.ref_protected == true && '--merge' || '--rebase' }}
49
+ MERGE_PR_STRATEGY : ${{github.ref_protected == true && '--merge' || '--rebase' }}
34
50
35
51
- name : Tag commit
36
52
uses : actions/github-script@v7
0 commit comments