Skip to content

Commit d7a8869

Browse files
committed
ci: fix zizmor findings
1 parent 9a28b1b commit d7a8869

3 files changed

Lines changed: 30 additions & 10 deletions

File tree

.github/actions/cargo-build-macos-binary/action.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,11 @@ inputs:
1313
runs:
1414
using: "composite"
1515
steps:
16-
- run: echo "ASSET_FULL_NAME=quickwit-${{ inputs.version }}-${{ inputs.target }}" >> $GITHUB_ENV
16+
- run: echo "ASSET_FULL_NAME=quickwit-${INPUTS_VERSION}-${INPUTS_TARGET}" >> $GITHUB_ENV
1717
shell: bash
18+
env:
19+
INPUTS_VERSION: ${{ inputs.version }}
20+
INPUTS_TARGET: ${{ inputs.target }}
1821
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
1922
with:
2023
node-version: 20
@@ -31,9 +34,11 @@ runs:
3134
shell: bash
3235
run: curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain none -y
3336
- name: Add target ${{ inputs.target }}
34-
run: rustup target add ${{ inputs.target }}
37+
run: rustup target add ${INPUTS_TARGET}
3538
shell: bash
3639
working-directory: ./quickwit
40+
env:
41+
INPUTS_TARGET: ${{ inputs.target }}
3742
- name: Retrieve and export commit date, hash, and tags
3843
run: |
3944
echo "QW_COMMIT_DATE=$(TZ=UTC0 git log -1 --format=%cd --date=format-local:%Y-%m-%dT%H:%M:%SZ)" >> $GITHUB_ENV
@@ -50,9 +55,12 @@ runs:
5055
QW_COMMIT_TAGS: ${{ env.QW_COMMIT_TAGS }}
5156
- name: Bundle archive
5257
run: |
53-
make archive BINARY_FILE=quickwit/target/${{ inputs.target }}/release/quickwit \
54-
BINARY_VERSION=${{ inputs.version }} ARCHIVE_NAME=${{ env.ASSET_FULL_NAME }}
58+
make archive BINARY_FILE=quickwit/target/${INPUTS_TARGET}/release/quickwit \
59+
BINARY_VERSION=${INPUTS_VERSION} ARCHIVE_NAME=${ASSET_FULL_NAME}
5560
shell: bash
61+
env:
62+
INPUTS_TARGET: ${{ inputs.target }}
63+
INPUTS_VERSION: ${{ inputs.version }}
5664
- name: Save binary archive for three days
5765
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
5866
with:

.github/actions/cross-build-binary/action.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,11 @@ inputs:
1313
runs:
1414
using: "composite"
1515
steps:
16-
- run: echo "ASSET_FULL_NAME=quickwit-${{ inputs.version }}-${{ inputs.target }}" >> $GITHUB_ENV
16+
- run: echo "ASSET_FULL_NAME=quickwit-${INPUTS_VERSION}-${INPUTS_TARGET}" >> $GITHUB_ENV
1717
shell: bash
18+
env:
19+
INPUTS_VERSION: ${{ inputs.version }}
20+
INPUTS_TARGET: ${{ inputs.target }}
1821
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
1922
with:
2023
node-version: 20
@@ -37,18 +40,22 @@ runs:
3740
echo "QW_COMMIT_TAGS=$(git tag --points-at HEAD | tr '\n' ',')" >> $GITHUB_ENV
3841
shell: bash
3942
- name: Build Quickwit
40-
run: cross build --release --features release-feature-vendored-set --target ${{ inputs.target }} --bin quickwit
43+
run: cross build --release --features release-feature-vendored-set --target ${INPUTS_TARGET} --bin quickwit
4144
shell: bash
4245
env:
4346
QW_COMMIT_DATE: ${{ env.QW_COMMIT_DATE }}
4447
QW_COMMIT_HASH: ${{ env.QW_COMMIT_HASH }}
4548
QW_COMMIT_TAGS: ${{ env.QW_COMMIT_TAGS }}
49+
INPUTS_TARGET: ${{ inputs.target }}
4650
working-directory: ./quickwit
4751
- name: Bundle archive
4852
run: |
49-
make archive BINARY_FILE=quickwit/target/${{ inputs.target }}/release/quickwit \
50-
BINARY_VERSION=${{ inputs.version }} ARCHIVE_NAME=${{ env.ASSET_FULL_NAME }}
53+
make archive BINARY_FILE=quickwit/target/${INPUTS_TARGET}/release/quickwit \
54+
BINARY_VERSION=${INPUTS_VERSION} ARCHIVE_NAME=${ASSET_FULL_NAME}
5155
shell: bash
56+
env:
57+
INPUTS_TARGET: ${{ inputs.target }}
58+
INPUTS_VERSION: ${{ inputs.version }}
5259
- name: Save binary archive for three days
5360
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
5461
with:

.github/workflows/publish_docker_images.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,14 @@ jobs:
7979
echo "QW_COMMIT_DATE=$(TZ=UTC0 git log -1 --format=%cd --date=format-local:%Y-%m-%dT%H:%M:%SZ)" >> $GITHUB_ENV
8080
echo "QW_COMMIT_HASH=$(git rev-parse HEAD)" >> $GITHUB_ENV
8181
echo "QW_COMMIT_TAGS=$(git tag --points-at HEAD | tr '\n' ',')" >> $GITHUB_ENV
82-
if [[ "${{ github.event_name }}" == "push" && "${{ github.ref_type }}" == "tag" && "${GITHUB_REF#refs/tags/}" == *"jemprof"* ]]; then
82+
if [[ "${EVENT_NAME}" == "push" && "${REF_TYPE}" == "tag" && "${GITHUB_REF#refs/tags/}" == *"jemprof"* ]]; then
8383
echo "CARGO_FEATURES=release-jemalloc-profiled" >> $GITHUB_ENV
8484
else
8585
echo "CARGO_FEATURES=release-feature-set" >> $GITHUB_ENV
8686
fi
87+
env:
88+
EVENT_NAME: ${{ github.event_name }}
89+
REF_TYPE: ${{ github.ref_type }}
8790

8891
- name: Build and push image
8992
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
@@ -157,4 +160,6 @@ jobs:
157160
$(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *)
158161
- name: Inspect image
159162
run: |
160-
docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }}
163+
docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${STEPS_META_OUTPUTS_VERSION}
164+
env:
165+
STEPS_META_OUTPUTS_VERSION: ${{ steps.meta.outputs.version }}

0 commit comments

Comments
 (0)