Skip to content

Commit b68b03e

Browse files
committed
ci pip-compile: allow adding extra labels to PRs
1 parent c6f4487 commit b68b03e

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

.github/workflows/reusable-pip-compile.yml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ name: "Refresh pinned dependencies"
2929
reset-branch:
3030
type: boolean
3131
default: false
32+
labels:
33+
type: string
34+
default: ""
3235
jobs:
3336
refresh:
3437
runs-on: ubuntu-latest
@@ -86,6 +89,7 @@ jobs:
8689
pr_branch: "${{ inputs.pr-branch }}"
8790
message: "${{ inputs.message }}"
8891
changed_files: "${{ inputs.changed-files }}"
92+
labels: "${{ inputs.labels }}"
8993
run: |
9094
set -x
9195
git diff || :
@@ -99,9 +103,18 @@ jobs:
99103
git push --force origin "${pr_branch}"
100104
if [ "${{ steps.branch.outputs.branch-exists }}" = "false" ]
101105
then
102-
gh pr create \
103-
--base "${base_branch}" \
104-
--title "${message}" \
105-
--body "" \
106+
command=(gh pr create
107+
--base "${base_branch}"
108+
--title "${message}"
109+
--body ""
106110
--label dependency_update
111+
)
112+
# Add custom labels to the command.
113+
old_ifs="$IFS"
114+
IFS=","
115+
for label in ${labels}; do
116+
command+=("--label" "${label}")
117+
done
118+
IFS="${old_ifs}"
107119
fi
120+
"${command[@]}"

0 commit comments

Comments
 (0)