Skip to content

escape characters 2

escape characters 2 #5

# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0
name: Verify Release - Zip Files
on:
workflow_call:
inputs:
version:
description: The x.y.z version (also need to specify applicable suffixes like +ent and -dev)'
required: true
type: string
runs-on:
description: An expression indicating which kind of runners to use.
required: true
type: string
include-fips:
description: Indicates whether we should check for FIPS binaries and docker images. Versions below 1.16.0 should be false.
required: false
type: boolean
default: true
jobs:
verify-zips:
runs-on: ${{ fromJSON(inputs.runs-on) }}
strategy:
matrix:
release: [ {
name: oss,
suffix: "",
targets: [
{ os: "darwin", arch: "amd64" },
{ os: "darwin", arch: "arm64" },
{ os: "freebsd", arch: "386" },
{ os: "freebsd", arch: "amd64" },
{ os: "linux", arch: "386" },
{ os: "linux", arch: "amd64" },
{ os: "linux", arch: "arm" },
{ os: "linux", arch: "arm64" },
{ os: "solaris", arch: "amd64" },
{ os: "windows", arch: "386" },
{ os: "windows", arch: "amd64" }
],
fips: false
},
{
name: enterprise,
suffix: "\+ent",

Check failure on line 48 in .github/workflows/reusable-verify-release-zip.yaml

View workflow run for this annotation

GitHub Actions / .github/workflows/reusable-verify-release-zip.yaml

Invalid workflow file

You have an error in your yaml syntax on line 48
targets: [
{ os: "darwin", arch: "amd64" },
{ os: "darwin", arch: "arm64" },
{ os: "freebsd", arch: "386" },
{ os: "freebsd", arch: "amd64" },
{ os: "linux", arch: "386" },
{ os: "linux", arch: "amd64" },
{ os: "linux", arch: "arm" },
{ os: "linux", arch: "arm64" },
{ os: "solaris", arch: "amd64" },
{ os: "windows", arch: "386" },
{ os: "windows", arch: "amd64" }
],
fips: false
},
{
name: ent-fips,
suffix: "\+ent\.fips1402",
targets: [
{ os: "linux", arch: "amd64" },
{ os: "linux", arch: "arm64" },
{ os: "windows", arch: "amd64" },
{ os: "windows", arch: "arm64" }
],
fips: true
}
]
fail-fast: false
steps:
- name: verify zips - ${{ matrix.release.name }}
if: ${{ !matrix.release.fips || (inputs.include-fips && matrix.release.fips) }}
run: |
export zips=$(echo '${{ toJSON(matrix.release.targets) }}' | jq -r 'map("consul" + "_" + "${{ inputs.version }}" + "${{ matrix.release.suffix }}" + "_" + .os + "_" + .arch + "\.zip" )| join("|")')
expected=$(echo '${{ toJSON(matrix.release.targets) }}' | jq length)
found=$(curl https://releases.hashicorp.com/consul/${{ inputs.version }}${{ matrix.release.suffix }}/ \
| grep -E "${zips}" \
| wc -l \
| awk '$1=$1')
echo "Expected: ${expected}. Found: ${found}"
if [[ ${found} != ${expected} ]]; then
echo "ERROR: incorrect number of zip files found."
exit 1
fi