Skip to content

Commit e5d9881

Browse files
Merge pull request #165 from IABTechLab/sch-UID2-patch-pr-workflow-allow-multiple-prs
Allow commit_and_merge_pr action to make more than one PR at once
2 parents 667ac6d + 7aa8f43 commit e5d9881

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

actions/commit_pr_and_merge/action.yaml

+8-2
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@ runs:
4747
echo "changes_exist=true" >> $GITHUB_OUTPUT
4848
fi
4949
50+
- name: Generate random number for branch
51+
id: random-number
52+
shell: bash
53+
run: |
54+
echo "num=${RANDOM}" >> $GITHUB_OUTPUT
55+
5056
- name: Commit to new branch
5157
uses: EndBug/add-and-commit@v9
5258
if: steps.changes.outputs.changes_exist == 'true'
@@ -55,7 +61,7 @@ runs:
5561
message: '[CI Pipeline] ${{ inputs.message }}'
5662
author_name: Release Workflow
5763
author_email: [email protected]
58-
new_branch: ci-${{ github.sha }}
64+
new_branch: 'ci-${{ github.sha }}-${{ steps.random-number.outputs.num }}'
5965
add: ${{ inputs.add }}
6066

6167
- name: Create PR
@@ -68,7 +74,7 @@ runs:
6874
owner: context.repo.owner,
6975
repo: context.repo.repo,
7076
title: '[CI Pipeline] ${{ inputs.message }}',
71-
head: 'ci-${{ github.sha }}',
77+
head: 'ci-${{ github.sha }}-${{ steps.random-number.outputs.num }}',
7278
base: '${{ inputs.base_branch == '' && github.ref_name || inputs.base_branch }}',
7379
body: '[CI Pipeline] Automated update'
7480
})).data;

0 commit comments

Comments
 (0)