From 7c062ef92b54311cfa3d804778e9e933cb5886a7 Mon Sep 17 00:00:00 2001 From: Arun Sathiya Date: Thu, 18 Jan 2024 15:08:41 -0800 Subject: [PATCH 1/2] ci: Use GITHUB_OUTPUT envvar instead of set-output command `save-state` and `set-output` commands used in GitHub Actions are deprecated and [GitHub recommends using environment files](https://github.blog/changelog/2023-07-24-github-actions-update-on-save-state-and-set-output-commands/). This PR updates the usage of `set-output` to `$GITHUB_OUTPUT` Instructions for envvar usage from GitHub docs: https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-output-parameter --- .github/workflows/build-and-publish.yaml | 8 ++++---- .github/workflows/helm-test.yaml | 2 +- .github/workflows/release.yaml | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-and-publish.yaml b/.github/workflows/build-and-publish.yaml index 66c0152ec..87d38d20d 100644 --- a/.github/workflows/build-and-publish.yaml +++ b/.github/workflows/build-and-publish.yaml @@ -52,10 +52,10 @@ jobs: VERSION=${GITHUB_REF/refs\/tags\//} BUILD_VERSION=${VERSION} fi - echo ::set-output name=BUILD_DATE::$(date -u +'%Y-%m-%dT%H:%M:%SZ') - echo ::set-output name=VERSION::${VERSION} - echo ::set-output name=BUILD_VERSION::${BUILD_VERSION} - echo ::set-output name=BUILD_SHA::${BUILD_SHA} + echo "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT + echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT + echo "BUILD_VERSION=${BUILD_VERSION}" >> $GITHUB_OUTPUT + echo "BUILD_SHA=${BUILD_SHA}" >> $GITHUB_OUTPUT - name: Setup QEMU uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0 with: diff --git a/.github/workflows/helm-test.yaml b/.github/workflows/helm-test.yaml index abe72dfc8..4e4a5cd60 100644 --- a/.github/workflows/helm-test.yaml +++ b/.github/workflows/helm-test.yaml @@ -35,7 +35,7 @@ jobs: run: | changed=$(ct list-changed --config ct.yaml) if [[ -n "$changed" ]]; then - echo "::set-output name=changed::true" + echo "changed=true" >> $GITHUB_OUTPUT fi - name: Run docs-testing (helm-docs) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 0fc7a7ace..3f48184f5 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -44,8 +44,8 @@ jobs: if [[ $GITHUB_REF == refs/tags/* ]]; then VERSION=${GITHUB_REF/refs\/tags\//} fi - echo ::set-output name=BUILD_DATE::$(date -u +'%Y-%m-%dT%H:%M:%SZ') - echo ::set-output name=VERSION::${VERSION} + echo "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT + echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT - name: Setup QEMU uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0 with: From 0ee4690ac4993f32a173fb8a9d0b3f90064236cf Mon Sep 17 00:00:00 2001 From: Arun Date: Mon, 22 Jan 2024 23:25:46 -0800 Subject: [PATCH 2/2] Quote envvar to match documentation --- .github/workflows/build-and-publish.yaml | 8 ++++---- .github/workflows/helm-test.yaml | 2 +- .github/workflows/release.yaml | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-and-publish.yaml b/.github/workflows/build-and-publish.yaml index 87d38d20d..523a719c8 100644 --- a/.github/workflows/build-and-publish.yaml +++ b/.github/workflows/build-and-publish.yaml @@ -52,10 +52,10 @@ jobs: VERSION=${GITHUB_REF/refs\/tags\//} BUILD_VERSION=${VERSION} fi - echo "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT - echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT - echo "BUILD_VERSION=${BUILD_VERSION}" >> $GITHUB_OUTPUT - echo "BUILD_SHA=${BUILD_SHA}" >> $GITHUB_OUTPUT + echo "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> "$GITHUB_OUTPUT" + echo "VERSION=${VERSION}" >> "$GITHUB_OUTPUT" + echo "BUILD_VERSION=${BUILD_VERSION}" >> "$GITHUB_OUTPUT" + echo "BUILD_SHA=${BUILD_SHA}" >> "$GITHUB_OUTPUT" - name: Setup QEMU uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0 with: diff --git a/.github/workflows/helm-test.yaml b/.github/workflows/helm-test.yaml index 4e4a5cd60..27cf438bb 100644 --- a/.github/workflows/helm-test.yaml +++ b/.github/workflows/helm-test.yaml @@ -35,7 +35,7 @@ jobs: run: | changed=$(ct list-changed --config ct.yaml) if [[ -n "$changed" ]]; then - echo "changed=true" >> $GITHUB_OUTPUT + echo "changed=true" >> "$GITHUB_OUTPUT" fi - name: Run docs-testing (helm-docs) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 3f48184f5..975e2d66c 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -44,8 +44,8 @@ jobs: if [[ $GITHUB_REF == refs/tags/* ]]; then VERSION=${GITHUB_REF/refs\/tags\//} fi - echo "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT - echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT + echo "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> "$GITHUB_OUTPUT" + echo "VERSION=${VERSION}" >> "$GITHUB_OUTPUT" - name: Setup QEMU uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0 with: