Skip to content

Commit

Permalink
fix(ci): update the regex used to detect ngx_wasm_module version
Browse files Browse the repository at this point in the history
When pinned to a release or tag, the line in .requirements has a
trailing comment:

> NGX_WASM_MODULE=ddb3fa8f7cacc81557144cf22706484eabd79a84 # 0.1.0

...but this comment will not exist mid-release when we are not pinned to
a specific tag, so the regex was wrong.
  • Loading branch information
flrgh committed Dec 7, 2023
1 parent aba1910 commit 54884bd
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion .github/workflows/update-ngx-wasm-module.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,12 @@ jobs:
- name: Detect current version of NGX_WASM_MODULE in .requirements
id: check-kong
run: |
SHA=$(sed -nre 's/^NGX_WASM_MODULE=([^ ]+) .*/\1/p' < .requirements)
SHA=$(sed -nre 's/^NGX_WASM_MODULE=([^ ]+).*/\1/p' < .requirements)
echo "sha=$SHA" | tee -a "$GITHUB_OUTPUT"
if [[ -z ${SHA:-} ]]; then
echo "fatal: failed to parse ngx_wasm_module sha from .requirements file"
exit 1
fi
- name: Check Kong/ngx_wasm_module HEAD
id: check-repo
Expand All @@ -35,6 +39,10 @@ jobs:
run: |
SHA=$(gh api repos/Kong/ngx_wasm_module/commits/main --jq '.sha')
echo "sha=$SHA" | tee -a "$GITHUB_OUTPUT"
if [[ -z ${SHA:-} ]]; then
echo "fatal: failed to fetch sha from Kong/ngx_wasm_module repo"
exit 1
fi
- name: Update .requirements and create a pull request
if: steps.check-kong.outputs.sha != steps.check-repo.outputs.sha
Expand Down

0 comments on commit 54884bd

Please sign in to comment.