Skip to content

Commit be7ffd9

Browse files
committed
fix
1 parent 2f61e9e commit be7ffd9

File tree

1 file changed

+41
-4
lines changed

1 file changed

+41
-4
lines changed

.github/workflows/update-dependencies.yml

Lines changed: 41 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,9 +71,14 @@ 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
77+
- name: Debug Kolla version comparison
78+
run: |
79+
echo "Latest Tag: '${{ steps.latest_kolla_tag.outputs.latest_tag }}'"
80+
echo "Current Version: '${{ steps.current_kolla_version.outputs.version }}'"
81+
7682
- name: Update and commit Kolla version if needed
7783
if: steps.latest_kolla_tag.outputs.latest_tag != steps.current_kolla_version.outputs.version
7884
run: |
@@ -85,6 +91,7 @@ jobs:
8591
TAG: ${{ steps.latest_kolla_tag.outputs.latest_tag }}
8692
working-directory: src/kayobe-config
8793

94+
# --- 2. Kolla Ansible ---
8895
- name: Checkout Kolla Ansible repository
8996
uses: actions/checkout@v4
9097
with:
@@ -101,9 +108,14 @@ jobs:
101108
- name: Get current Kolla Ansible version
102109
id: current_kolla_ansible_version
103110
run: |
104-
VERSION=$(grep 'stackhpc_kolla_ansible_source_version:' src/kayobe-config/etc/kayobe/stackhpc.yml | sed 's/.*: //')
111+
VERSION=$(awk -F': ' '/stackhpc_kolla_ansible_source_version:/ {print $2}' src/kayobe-config/etc/kayobe/stackhpc.yml | xargs)
105112
echo "version=${VERSION}" >> $GITHUB_OUTPUT
106113
114+
- name: Debug Kolla Ansible version comparison
115+
run: |
116+
echo "Latest Tag: '${{ steps.latest_kolla_ansible_tag.outputs.latest_tag }}'"
117+
echo "Current Version: '${{ steps.current_kolla_ansible_version.outputs.version }}'"
118+
107119
- name: Update and commit Kolla Ansible version if needed
108120
if: steps.latest_kolla_ansible_tag.outputs.latest_tag != steps.current_kolla_ansible_version.outputs.version
109121
run: |
@@ -116,6 +128,7 @@ jobs:
116128
TAG: ${{ steps.latest_kolla_ansible_tag.outputs.latest_tag }}
117129
working-directory: src/kayobe-config
118130

131+
# --- 3. Kayobe ---
119132
- name: Checkout Kayobe repository
120133
uses: actions/checkout@v4
121134
with:
@@ -132,9 +145,14 @@ jobs:
132145
- name: Get current Kayobe version
133146
id: current_kayobe_version
134147
run: |
135-
VERSION=$(grep 'kayobe@stackhpc/' src/kayobe-config/requirements.txt | sed 's/.*@//')
148+
VERSION=$(awk -F'@' '/kayobe@stackhpc\// {print $2}' src/kayobe-config/requirements.txt | xargs)
136149
echo "version=${VERSION}" >> $GITHUB_OUTPUT
137150
151+
- name: Debug Kayobe version comparison
152+
run: |
153+
echo "Latest Tag: '${{ steps.latest_kayobe_tag.outputs.latest_tag }}'"
154+
echo "Current Version: '${{ steps.current_kayobe_version.outputs.version }}'"
155+
138156
- name: Update and commit Kayobe version if needed
139157
if: steps.latest_kayobe_tag.outputs.latest_tag != steps.current_kayobe_version.outputs.version
140158
run: |
@@ -147,15 +165,34 @@ jobs:
147165
TAG: ${{ steps.latest_kayobe_tag.outputs.latest_tag }}
148166
working-directory: src/kayobe-config
149167

168+
# --- 4. Push and Create Pull Request ---
169+
- name: Check for new commits
170+
id: check_commits
171+
run: |
172+
count=$(git rev-list --count ${{ inputs.openstack_version }}..HEAD)
173+
if [ "$count" -gt 0 ]; then
174+
echo "has_commits=true" >> $GITHUB_OUTPUT
175+
else
176+
echo "has_commits=false" >> $GITHUB_OUTPUT
177+
fi
178+
working-directory: src/kayobe-config
179+
180+
- name: Push commits
181+
if: steps.check_commits.outputs.has_commits == 'true'
182+
run: git push --force origin update-dependencies/${{ inputs.openstack_version }}
183+
working-directory: src/kayobe-config
184+
150185
- name: Propose changes via PR if required
151-
id: cpr
186+
if: steps.check_commits.outputs.has_commits == 'true'
152187
uses: peter-evans/create-pull-request@v7
153188
with:
154189
path: src/kayobe-config
155190
branch: update-dependencies/${{ inputs.openstack_version }}
191+
base: ${{ inputs.openstack_version }}
156192
delete-branch: true
157193
title: "chore(deps): Bump dependencies for OpenStack ${{ inputs.openstack_codename }}"
158194
body-path: pr_body.md
159195
labels: |
160196
automated
161197
${{ inputs.openstack_codename }}
198+

0 commit comments

Comments
 (0)