Skip to content

Commit

Permalink
Merge pull request ansible#1066 from gotmax23/pip-compile-label
Browse files Browse the repository at this point in the history
ci pip-compile: add appropriate labels to dev and docs jobs
  • Loading branch information
gotmax23 authored Jan 29, 2024
2 parents 8f2054e + 19a37c2 commit c8d6d3d
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 4 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/pip-compile-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ name: "Refresh dev dependencies"
reset-branch:
type: boolean
default: false
labels:
required: false
type: string
push:
branches:
- devel
Expand All @@ -37,4 +40,5 @@ jobs:
'pip-compile-3.10(static)'
'pip-compile-3.10(spelling)'
reset-branch: "${{ inputs.reset-branch || false }}"
labels: "${{ inputs.labels || 'backport-2.14,backport-2.15,backport-2.16,tooling' }}"
secrets: inherit
4 changes: 4 additions & 0 deletions .github/workflows/pip-compile-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ name: "Refresh docs build dependencies"
reset-branch:
type: boolean
default: false
labels:
required: false
type: string
push:
branches:
- devel
Expand All @@ -33,4 +36,5 @@ jobs:
pr-branch: "${{ inputs.pr-branch || 'pip-compile/devel/docs' }}"
nox-args: "-e 'pip-compile-3.10(requirements)' 'pip-compile-3.10(requirements-relaxed)'"
reset-branch: "${{ inputs.reset-branch || false }}"
labels: "${{ inputs.labels || 'doc builds,no_backport' }}"
secrets: inherit
21 changes: 17 additions & 4 deletions .github/workflows/reusable-pip-compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ name: "Refresh pinned dependencies"
reset-branch:
type: boolean
default: false
labels:
type: string
default: ""
jobs:
refresh:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -86,6 +89,7 @@ jobs:
pr_branch: "${{ inputs.pr-branch }}"
message: "${{ inputs.message }}"
changed_files: "${{ inputs.changed-files }}"
labels: "${{ inputs.labels }}"
run: |
set -x
git diff || :
Expand All @@ -99,9 +103,18 @@ jobs:
git push --force origin "${pr_branch}"
if [ "${{ steps.branch.outputs.branch-exists }}" = "false" ]
then
gh pr create \
--base "${base_branch}" \
--title "${message}" \
--body "" \
command=(gh pr create
--base "${base_branch}"
--title "${message}"
--body ""
--label dependency_update
)
# Add custom labels to the command.
old_ifs="$IFS"
IFS=","
for label in ${labels}; do
command+=("--label" "${label}")
done
IFS="${old_ifs}"
fi
"${command[@]}"

0 comments on commit c8d6d3d

Please sign in to comment.