Skip to content

Commit 5375158

Browse files
committed
ci: address fourth Copilot follow-up
Cross-port of dunglas/mercure#1246 follow-up: - Add `set -euo pipefail` to the Validate inputs step. - Hardcode mode 100644 for deletion entries since the mode is purely formal when sha is null. - Reword the verify_release_content comment to spell out that omitting the `require` keyword from the grep is what makes it match both block and single-line layouts.
1 parent 480e5cb commit 5375158

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

.github/workflows/release.yaml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ jobs:
3535
env:
3636
VERSION: ${{ inputs.version }}
3737
run: |
38+
set -euo pipefail
3839
if [[ "${GITHUB_REF}" != "refs/heads/main" ]]; then
3940
echo "::error::release.yaml must be dispatched against refs/heads/main, got ${GITHUB_REF}"
4041
exit 1
@@ -90,8 +91,9 @@ jobs:
9091
printf '%s\n' "${sha}"
9192
fi
9293
}
93-
# Match the frankenphp require entry in both `require ( ... )`
94-
# block form and single-line `require x v...` form.
94+
# The grep below deliberately omits the `require` keyword so
95+
# it matches both `require ( ... )` block layout (where the
96+
# entry is indented) and single-line `require x v...` layout.
9597
verify_release_content() {
9698
local ref="$1"
9799
if ! git show "${ref}:caddy/go.mod" 2>/dev/null \
@@ -263,8 +265,10 @@ jobs:
263265
'{path: $path, mode: $mode, type: "blob", sha: $sha}'
264266
done
265267
for path in "${deleted[@]}"; do
266-
jq -nc --arg path "${path}" --arg mode "$(mode_for "${path}")" \
267-
'{path: $path, mode: $mode, type: "blob", sha: null}'
268+
# Deletions need a valid mode but it's purely formal —
269+
# the entry only removes the path from the tree.
270+
jq -nc --arg path "${path}" \
271+
'{path: $path, mode: "100644", type: "blob", sha: null}'
268272
done
269273
} | jq -sc .
270274
)

0 commit comments

Comments
 (0)