Skip to content

Commit c8d6d3d

Browse files
authored
Merge pull request #1066 from gotmax23/pip-compile-label
ci pip-compile: add appropriate labels to dev and docs jobs
2 parents 8f2054e + 19a37c2 commit c8d6d3d

File tree

3 files changed

+25
-4
lines changed

3 files changed

+25
-4
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ name: "Refresh dev dependencies"
1515
reset-branch:
1616
type: boolean
1717
default: false
18+
labels:
19+
required: false
20+
type: string
1821
push:
1922
branches:
2023
- devel
@@ -37,4 +40,5 @@ jobs:
3740
'pip-compile-3.10(static)'
3841
'pip-compile-3.10(spelling)'
3942
reset-branch: "${{ inputs.reset-branch || false }}"
43+
labels: "${{ inputs.labels || 'backport-2.14,backport-2.15,backport-2.16,tooling' }}"
4044
secrets: inherit

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ name: "Refresh docs build dependencies"
1515
reset-branch:
1616
type: boolean
1717
default: false
18+
labels:
19+
required: false
20+
type: string
1821
push:
1922
branches:
2023
- devel
@@ -33,4 +36,5 @@ jobs:
3336
pr-branch: "${{ inputs.pr-branch || 'pip-compile/devel/docs' }}"
3437
nox-args: "-e 'pip-compile-3.10(requirements)' 'pip-compile-3.10(requirements-relaxed)'"
3538
reset-branch: "${{ inputs.reset-branch || false }}"
39+
labels: "${{ inputs.labels || 'doc builds,no_backport' }}"
3640
secrets: inherit

.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)