From 3e45ec6d03586e9aa910c172326eec82a60dff68 Mon Sep 17 00:00:00 2001 From: Nikita Skrynnik Date: Fri, 4 Aug 2023 12:58:48 +0700 Subject: [PATCH] s Signed-off-by: Nikita Skrynnik --- .github/workflows/update-go-version.yaml | 5 +++-- script.sh | 10 ++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) create mode 100755 script.sh diff --git a/.github/workflows/update-go-version.yaml b/.github/workflows/update-go-version.yaml index e85f42b..b687e4c 100644 --- a/.github/workflows/update-go-version.yaml +++ b/.github/workflows/update-go-version.yaml @@ -5,6 +5,7 @@ on: push: branches: - 'update/go_*' + - 'main' jobs: update-go-version: runs-on: ubuntu-latest @@ -21,10 +22,10 @@ jobs: id: get-go-version run: | OLD_GO_VERSION=$(grep -F "go-version: " .github/workflows/build-and-test.yaml) - OLD_GO_VERSION=${OLD_GO_VERSION//"go-version: "/""} + OLD_GO_VERSION=$(echo $OLD_GO_VERSION | sed -e 's/go-version: //g') OLD_GO_MAJOR_VERSION=${OLD_GO_VERSION%.*} - NEW_GO_VERSION=${${{ github.ref }}//"refs/heads/update/go_"/""} + NEW_GO_VERSION=$(echo "${{ github.ref }}" | sed 's/refs\/heads\/update\/go_//g') NEW_GO_MAJOR_VERSION=${NEW_GO_VERSION%.*} echo "Old go version $OLD_GO_VERSION" diff --git a/script.sh b/script.sh new file mode 100755 index 0000000..7fca0a5 --- /dev/null +++ b/script.sh @@ -0,0 +1,10 @@ + +string="refs/heads/update/go_1.30.8" +f=${string#refs/heads/update/go_} + +echo $f + +OLD_GO_VERSION=$(grep -F "go-version: " .github/workflows/build-and-test.yaml) +OLD_GO_VERSION=$(echo $OLD_GO_VERSION | sed -e 's/go-version: //g') + +echo $OLD_GO_VERSION \ No newline at end of file