@@ -118,29 +118,67 @@ jobs:
118118 git checkout -b ${{ needs.configure-branch-name.outputs.gh_head_ref }} || git checkout ${{ needs.configure-branch-name.outputs.gh_head_ref }}
119119 git pull origin ${{ needs.configure-branch-name.outputs.gh_head_ref }}
120120
121- - name : Compile Requirements
121+ - name : Compile Requirements (Python)
122+ if : matrix.parent_image_type != 'next'
122123 run : |
123124 pip-compile --quiet \
124125 --output-file ${{ matrix.app }}/requirements/${{ matrix.parent_image_type }}-requirements.txt \
125126 submodules/parent-images/requirements/${{ matrix.parent_image_type }}-requirements.in
126-
127- pip-compile --quiet \
128- --output-file ${{ matrix.app }}/requirements.txt \
129- ${{ matrix.app }}/requirements/requirements.in
130-
131- - name : Perform Edit/Git Operations
127+
128+ - name : Compile Requirements (Next)
129+ if : matrix.parent_image_type == 'next'
130+ run : |
131+ jq --slurp '.[0] * .[1]' \
132+ package.json \
133+ ${{ matrix.app }}/package.json \
134+ > package.json.tmp
135+ mv package.json.tmp ${{ matrix.app }}/package.json
136+
137+ - name : Perform Edit/Git Operations (Python)
138+ if : matrix.parent_image_type != 'next'
132139 run : |
133140 cd ${{ github.workspace }}/${{ matrix.app }}
134141
135- git add requirements*
142+ git add requirements/${{ matrix.parent_image_type }}-requirements.in
136143 git commit -m "ci: update ${{ matrix.parent_image_type }}-requirements.txt" || true
137144 git push origin ${{ needs.configure-branch-name.outputs.gh_head_ref }}
138- echo "::notice::${{ matrix.app }} updated to origin/${{ needs.configure-branch-name.outputs.gh_head_ref }}"
145+ echo "::notice::${{ matrix.app }} - updated ${{ matrix.parent_image_type }}-requirements.txt"
146+
147+ export exitcode=0
148+ pip-compile --quiet \
149+ --output-file requirements.txt \
150+ requirements/requirements.in || export exitcode=$?
151+
152+ if [ $exitcode -ne 0 ]; then
153+ echo "::error::pip-compile failed with exit code $exitcode"
154+ exit $exitcode
155+ else
156+ git add requirements.txt
157+ git commit -m "ci: update requirements.txt" || true
158+ git push origin ${{ needs.configure-branch-name.outputs.gh_head_ref }}
159+ echo "::notice::${{ matrix.app }} - updated requirements.txt"
160+ fi
139161
140162 gh pr create --draft \
141163 --title "${{ github.event.pull_request.title }}" \
142164 --body "${{ github.event.pull_request.body }}" \
143165 --base dev \
144166 --head ${{ needs.configure-branch-name.outputs.gh_head_ref }} \
145167 --repo ${{ github.repository_owner }}/${{ matrix.app }} || true
146-
168+
169+ - name : Perform Edit/Git Operations (Next)
170+ if : matrix.parent_image_type == 'next'
171+ run : |
172+ cd ${{ github.workspace }}/${{ matrix.app }}
173+
174+ git add package.json
175+ git commit -m "ci: update ${{ matrix.parent_image_type }} package.json" || true
176+ git push origin ${{ needs.configure-branch-name.outputs.gh_head_ref }}
177+ echo "::notice::${{ matrix.app }} - updated ${{ matrix.parent_image_type }} package.json"
178+
179+ gh pr create --draft \
180+ --title "${{ github.event.pull_request.title }}" \
181+ --body "${{ github.event.pull_request.body }}" \
182+ --base dev \
183+ --head ${{ needs.configure-branch-name.outputs.gh_head_ref }} \
184+ --repo ${{ github.repository_owner }}/${{ matrix.app }} || true
0 commit comments