Skip to content

Commit 7d3906e

Browse files
committed
fix
1 parent 2f61e9e commit 7d3906e

File tree

1 file changed

+26
-4
lines changed

1 file changed

+26
-4
lines changed

.github/workflows/update-dependencies.yml

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ jobs:
5454
echo "" >> pr_body.md
5555
echo "### Changes" >> pr_body.md
5656
57+
# --- 1. Kolla ---
5758
- name: Checkout Kolla repository
5859
uses: actions/checkout@v4
5960
with:
@@ -70,7 +71,7 @@ jobs:
7071
- name: Get current Kolla version
7172
id: current_kolla_version
7273
run: |
73-
VERSION=$(grep 'stackhpc_kolla_source_version:' src/kayobe-config/etc/kayobe/stackhpc.yml | sed 's/.*: //')
74+
VERSION=$(awk -F': ' '/stackhpc_kolla_source_version:/ {print $2}' src/kayobe-config/etc/kayobe/stackhpc.yml | xargs)
7475
echo "version=${VERSION}" >> $GITHUB_OUTPUT
7576
7677
- name: Update and commit Kolla version if needed
@@ -85,6 +86,7 @@ jobs:
8586
TAG: ${{ steps.latest_kolla_tag.outputs.latest_tag }}
8687
working-directory: src/kayobe-config
8788

89+
# --- 2. Kolla Ansible ---
8890
- name: Checkout Kolla Ansible repository
8991
uses: actions/checkout@v4
9092
with:
@@ -101,7 +103,7 @@ jobs:
101103
- name: Get current Kolla Ansible version
102104
id: current_kolla_ansible_version
103105
run: |
104-
VERSION=$(grep 'stackhpc_kolla_ansible_source_version:' src/kayobe-config/etc/kayobe/stackhpc.yml | sed 's/.*: //')
106+
VERSION=$(awk -F': ' '/stackhpc_kolla_ansible_source_version:/ {print $2}' src/kayobe-config/etc/kayobe/stackhpc.yml | xargs)
105107
echo "version=${VERSION}" >> $GITHUB_OUTPUT
106108
107109
- name: Update and commit Kolla Ansible version if needed
@@ -116,6 +118,7 @@ jobs:
116118
TAG: ${{ steps.latest_kolla_ansible_tag.outputs.latest_tag }}
117119
working-directory: src/kayobe-config
118120

121+
# --- 3. Kayobe ---
119122
- name: Checkout Kayobe repository
120123
uses: actions/checkout@v4
121124
with:
@@ -132,7 +135,7 @@ jobs:
132135
- name: Get current Kayobe version
133136
id: current_kayobe_version
134137
run: |
135-
VERSION=$(grep 'kayobe@stackhpc/' src/kayobe-config/requirements.txt | sed 's/.*@//')
138+
VERSION=$(awk -F'@' '/kayobe@stackhpc\// {print $2}' src/kayobe-config/requirements.txt | xargs)
136139
echo "version=${VERSION}" >> $GITHUB_OUTPUT
137140
138141
- name: Update and commit Kayobe version if needed
@@ -147,15 +150,34 @@ jobs:
147150
TAG: ${{ steps.latest_kayobe_tag.outputs.latest_tag }}
148151
working-directory: src/kayobe-config
149152

153+
# --- 4. Push and Create Pull Request ---
154+
- name: Check for new commits
155+
id: check_commits
156+
run: |
157+
count=$(git rev-list --count ${{ inputs.openstack_version }}..HEAD)
158+
if [ "$count" -gt 0 ]; then
159+
echo "has_commits=true" >> $GITHUB_OUTPUT
160+
else
161+
echo "has_commits=false" >> $GITHUB_OUTPUT
162+
fi
163+
working-directory: src/kayobe-config
164+
165+
- name: Push commits
166+
if: steps.check_commits.outputs.has_commits == 'true'
167+
run: git push --force origin update-dependencies/${{ inputs.openstack_version }}
168+
working-directory: src/kayobe-config
169+
150170
- name: Propose changes via PR if required
151-
id: cpr
171+
if: steps.check_commits.outputs.has_commits == 'true'
152172
uses: peter-evans/create-pull-request@v7
153173
with:
154174
path: src/kayobe-config
155175
branch: update-dependencies/${{ inputs.openstack_version }}
176+
base: ${{ inputs.openstack_version }}
156177
delete-branch: true
157178
title: "chore(deps): Bump dependencies for OpenStack ${{ inputs.openstack_codename }}"
158179
body-path: pr_body.md
159180
labels: |
160181
automated
161182
${{ inputs.openstack_codename }}
183+

0 commit comments

Comments
 (0)