Skip to content

Commit

Permalink
fix: iterate over releases from env var (#429)
Browse files Browse the repository at this point in the history
This fixes an issue where single quotes within releases were not
escaped.

Copied directly from npm/proc-log#79
  • Loading branch information
lukekarrys committed Apr 15, 2024
1 parent 8906397 commit 5d806ab
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/release-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ jobs:
- name: Publish
env:
PUBLISH_TOKEN: ${{ secrets.PUBLISH_TOKEN }}
RELEASES: ${{ inputs.releases }}
run: |
EXIT_CODE=0
Expand All @@ -65,7 +66,7 @@ jobs:
fi
}
for release in $(echo '${{ inputs.releases }}' | jq -r '.[] | @base64'); do
for release in $(echo $RELEASES | jq -r '.[] | @base64'); do
PUBLISH_TAG=$(echo "$release" | base64 --decode | jq -r .publishTag)
STATUS=$(each_release "$PUBLISH_TAG")
if [[ "$STATUS" -eq 1 ]]; then
Expand Down
3 changes: 2 additions & 1 deletion lib/content/_job-release-integration-yml.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ steps:
- name: Publish
env:
PUBLISH_TOKEN: $\{{ secrets.PUBLISH_TOKEN }}
RELEASES: $\{{ inputs.releases }}
{{else}}
{{> stepsSetupYml }}
- name: Check If Published
Expand All @@ -30,7 +31,7 @@ steps:
fi
}

for release in $(echo '$\{{ inputs.releases }}' | jq -r '.[] | @base64'); do
for release in $(echo $RELEASES | jq -r '.[] | @base64'); do
{{#if publish}}
PUBLISH_TAG=$(echo "$release" | base64 --decode | jq -r .publishTag)
STATUS=$(each_release "$PUBLISH_TAG")
Expand Down
6 changes: 3 additions & 3 deletions tap-snapshots/test/apply/source-snapshots.js.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -897,7 +897,7 @@ jobs:
fi
}
for release in $(echo '\${{ inputs.releases }}' | jq -r '.[] | @base64'); do
for release in $(echo $RELEASES | jq -r '.[] | @base64'); do
SPEC="$(echo "$release" | base64 --decode | jq -r .pkgName)@$(echo "$release" | base64 --decode | jq -r .version)"
STATUS=$(each_release "$SPEC")
if [[ "$STATUS" -eq 1 ]]; then
Expand Down Expand Up @@ -2539,7 +2539,7 @@ jobs:
fi
}
for release in $(echo '\${{ inputs.releases }}' | jq -r '.[] | @base64'); do
for release in $(echo $RELEASES | jq -r '.[] | @base64'); do
SPEC="$(echo "$release" | base64 --decode | jq -r .pkgName)@$(echo "$release" | base64 --decode | jq -r .version)"
STATUS=$(each_release "$SPEC")
if [[ "$STATUS" -eq 1 ]]; then
Expand Down Expand Up @@ -4053,7 +4053,7 @@ jobs:
fi
}
for release in $(echo '\${{ inputs.releases }}' | jq -r '.[] | @base64'); do
for release in $(echo $RELEASES | jq -r '.[] | @base64'); do
SPEC="$(echo "$release" | base64 --decode | jq -r .pkgName)@$(echo "$release" | base64 --decode | jq -r .version)"
STATUS=$(each_release "$SPEC")
if [[ "$STATUS" -eq 1 ]]; then
Expand Down

0 comments on commit 5d806ab

Please sign in to comment.