Skip to content

Commit dd66460

Browse files
chore(ci): actionlint fix
This shouldn't matter, since go package names cannot contain spaces, but this fixes an issue where spaces in the release paths would cause the for loop to fail.
1 parent 9ca042d commit dd66460

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

.github/workflows/release.yaml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
- id: todo
3131
if: fromJson(steps.release-please.outputs.releases_created)
3232
run: |
33-
for x in ${{join(fromJson(steps.release-please.outputs.paths_released), ' ')}}; do
33+
<<<"$RELEASED_PATHS" jq -r '.[]'| while IFS= read -r x; do
3434
case "$x" in
3535
lib/ocrypto)
3636
echo "TO_UPDATE=['examples','sdk','service']">>"$GITHUB_OUTPUT"
@@ -60,7 +60,8 @@ jobs:
6060
;;
6161
esac
6262
done
63-
63+
env:
64+
RELEASED_PATHS: ${{ toJson(steps.release-please.outputs.paths_released) }}
6465
update-go-mods:
6566
runs-on: ubuntu-latest
6667
needs:
@@ -78,15 +79,15 @@ jobs:
7879
- run: |
7980
git checkout -b update-go-mods-for-${{matrix.path}}
8081
git push -f -u origin update-go-mods-for-${{matrix.path}}
81-
cd ${{matrix.path}}
82-
for x in ${{join(fromJson(needs.release-please.outputs.paths_released), ' ')}}; do
83-
export pkg=github.com/opentdf/platform/${x}
82+
cd ${{matrix.path}} || exit 1
83+
<<<"$RELEASED_PATHS" jq -r '.[]'| while IFS= read -r x; do
84+
export pkg="github.com/opentdf/platform/${x}"
8485
if go mod edit --json | jq -e '.Replace[] | select(.Old.Path == env.pkg)'; then
85-
go mod edit --dropreplace=$pkg
86+
go mod edit --dropreplace="$pkg"
8687
fi
8788
echo "Should we update [${pkg}] in [${{ matrix.path }}]?"
8889
if go mod edit --json | jq -e '.Require[] | select(.Path == env.pkg)'; then
89-
ver=$(jq -r .\[\"${x}\"\] < "${GITHUB_WORKSPACE}/.release-please-manifest.json")
90+
ver="$(jq -r --arg x "$x" '.[$x]' <"${GITHUB_WORKSPACE}"/.release-please-manifest.json)"
9091
echo "go get ${pkg}@v${ver}"
9192
go get "${pkg}@v${ver}"
9293
fi
@@ -99,6 +100,7 @@ jobs:
99100
git diff
100101
env:
101102
GONOSUMDB: github.com/opentdf/platform/${{join(fromJson(needs.release-please.outputs.paths_released), ',github.com/opentdf/platform/')}}
103+
RELEASED_PATHS: ${{ toJson(needs.release-please.outputs.paths_released) }}
102104
- uses: planetscale/ghcommit-action@d4176bfacef926cc2db351eab20398dfc2f593b5
103105
with:
104106
commit_message: "fix(core): Autobump ${{ matrix.path }}"

0 commit comments

Comments
 (0)