From a583fd5e97ce0c78b9dcd9163ace0d4b4b701336 Mon Sep 17 00:00:00 2001 From: Austin Vazquez Date: Sat, 1 Jun 2024 23:47:46 +0000 Subject: [PATCH] Fix bug in update getting started guide workflow This change fixes a bug in the update getting started guide workflow when assertions are disabled. This change also fixes a bug where '--verbose' executed git diff command in interactive mode. Signed-off-by: Austin Vazquez --- .github/workflows/update-getting-started-guide.yml | 8 +------- docs/getting-started.md | 2 +- scripts/update-getting-started-guide-version.sh | 10 ++++++++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/update-getting-started-guide.yml b/.github/workflows/update-getting-started-guide.yml index 5f896a681..e650ed4f9 100644 --- a/.github/workflows/update-getting-started-guide.yml +++ b/.github/workflows/update-getting-started-guide.yml @@ -23,9 +23,6 @@ jobs: contents: read pull-requests: read - env: - RELEASE_TAG: '' - steps: - uses: actions/checkout@v4 with: @@ -33,11 +30,8 @@ jobs: docs/getting-started.md scripts/update-getting-started-guide-version.sh - - name: Mock release tag on pull request - run: echo "RELEASE_TAG=v0.0.0-${{ github.event.pull_request.number }}" >> $GITHUB_ENV - - name: Test update getting started version - run: bash scripts/update-getting-started-guide-version.sh --assert ${{ env.RELEASE_TAG }} + run: bash scripts/update-getting-started-guide-version.sh --assert v0.0.0-${{ github.event.pull_request.number }} update-version: if: github.event_name == 'release' diff --git a/docs/getting-started.md b/docs/getting-started.md index 285d84d22..85582dfa4 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -54,7 +54,7 @@ directory (`/usr/local/bin`): > You can find other download link in the release page that matches your machine. ```shell -version="0.6.1" +version="0.7.0" wget https://github.com/awslabs/soci-snapshotter/releases/download/v${version}/soci-snapshotter-${version}-linux-amd64.tar.gz sudo tar -C /usr/local/bin -xvf soci-snapshotter-${version}-linux-amd64.tar.gz soci soci-snapshotter-grpc ``` diff --git a/scripts/update-getting-started-guide-version.sh b/scripts/update-getting-started-guide-version.sh index 00147a333..2da8f1208 100755 --- a/scripts/update-getting-started-guide-version.sh +++ b/scripts/update-getting-started-guide-version.sh @@ -69,5 +69,11 @@ assert_diff() { sed -i -E "s/version=\"([0-9]+\.){2}[0-9]+\"/version=\"${VERSION}\"/" docs/getting-started.md -[ $VERBOSE = true ] && git diff -[ $ASSERT = true ] && assert_diff +if [ $VERBOSE = true ]; then + git --no-pager diff +fi + +if [ $ASSERT = true ]; then + assert_diff +fi +