From c54e7eb9e37e8ef5bb948eff6141cdddf584a6f9 Mon Sep 17 00:00:00 2001
From: Joel Takvorian <joel.takvorian@qaraywa.net>
Date: Mon, 23 Jan 2023 09:23:13 +0100
Subject: [PATCH] Upgrade github actions (#89)

* Upgrade github actions

* Update actions/github-script@v6
---
 .github/workflows/pull_request.yml     |  4 ++--
 .github/workflows/pull_request_e2e.yml |  4 ++--
 .github/workflows/push_image.yml       |  9 ++++-----
 .github/workflows/push_image_pr.yml    | 13 ++++++-------
 .github/workflows/release.yml          | 11 +++++------
 5 files changed, 19 insertions(+), 22 deletions(-)

diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml
index edf5f3b4..64e697d6 100644
--- a/.github/workflows/pull_request.yml
+++ b/.github/workflows/pull_request.yml
@@ -11,9 +11,9 @@ jobs:
     name: test
     runs-on: ubuntu-latest
     steps:
-    - uses: actions/checkout@v2
+    - uses: actions/checkout@v3
     - name: Set up Go
-      uses: actions/setup-go@v2
+      uses: actions/setup-go@v3
       with:
         go-version: 1.18
     - name: Install make
diff --git a/.github/workflows/pull_request_e2e.yml b/.github/workflows/pull_request_e2e.yml
index 4fcb4207..2243738a 100644
--- a/.github/workflows/pull_request_e2e.yml
+++ b/.github/workflows/pull_request_e2e.yml
@@ -15,11 +15,11 @@ jobs:
     - name: install make
       run: sudo apt-get install make
     - name: set up go 1.x
-      uses: actions/setup-go@v2
+      uses: actions/setup-go@v3
       with:
         go-version: 1.18
     - name: checkout
-      uses: actions/checkout@v2
+      uses: actions/checkout@v3
     - name: run end-to-end tests
       run: make tests-e2e
     - name: upload e2e test logs
diff --git a/.github/workflows/push_image.yml b/.github/workflows/push_image.yml
index 9b541818..a2e4f729 100644
--- a/.github/workflows/push_image.yml
+++ b/.github/workflows/push_image.yml
@@ -22,11 +22,11 @@ jobs:
       - name: install make
         run: sudo apt-get install make
       - name: set up go 1.x
-        uses: actions/setup-go@v2
+        uses: actions/setup-go@v3
         with:
           go-version: ${{ matrix.go }}
       - name: checkout
-        uses: actions/checkout@v2
+        uses: actions/checkout@v3
       - name: build images
         run: make ci-images-build
       - name: podman login to quay.io
@@ -36,14 +36,13 @@ jobs:
           password: ${{ env.REGISTRY_PASSWORD }}
           registry: quay.io
       - name: get short sha
-        id: shortsha
-        run: echo "::set-output name=short_sha::$(git rev-parse --short HEAD)"
+        run: echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
       - name: push to quay.io
         id: push-to-quay
         uses: redhat-actions/push-to-registry@v2
         with:
           image: ${{ env.IMAGE }}
-          tags: ${{ env.TAGS }} ${{ steps.shortsha.outputs.short_sha }}
+          tags: ${{ env.TAGS }} ${{ env.short_sha }}
           registry: ${{ env.REGISTRY }}
       - name: print image url
         run: echo "Image pushed to ${{ steps.push-to-quay.outputs.registry-paths }}"
\ No newline at end of file
diff --git a/.github/workflows/push_image_pr.yml b/.github/workflows/push_image_pr.yml
index faf41691..1542a529 100644
--- a/.github/workflows/push_image_pr.yml
+++ b/.github/workflows/push_image_pr.yml
@@ -13,7 +13,7 @@ jobs:
   push-pr-image:
     if: ${{ github.event.label.name == 'ok-to-test' }}
     name: push PR image
-    runs-on: ubuntu-20.04
+    runs-on: ubuntu-latest
     strategy:
       matrix:
         go: ['1.18']
@@ -21,11 +21,11 @@ jobs:
       - name: install make
         run: sudo apt-get install make
       - name: set up go 1.x
-        uses: actions/setup-go@v2
+        uses: actions/setup-go@v3
         with:
           go-version: ${{ matrix.go }}
       - name: checkout
-        uses: actions/checkout@v2
+        uses: actions/checkout@v3
         with:
           ref: "refs/pull/${{ github.event.number }}/merge"
       - name: build images
@@ -37,16 +37,15 @@ jobs:
           password: ${{ secrets.QUAY_SECRET }}
           registry: quay.io
       - name: get short sha
-        id: shortsha
-        run: echo "::set-output name=short_sha::$(git rev-parse --short HEAD)"
+        run: echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
       - name: push to quay.io
         id: push-to-quay
         uses: redhat-actions/push-to-registry@v2
         with:
           image: ${{ env.IMAGE }}
-          tags: ${{ steps.shortsha.outputs.short_sha }}
+          tags: ${{ env.short_sha }}
           registry: ${{ env.REGISTRY }}
-      - uses: actions/github-script@v5
+      - uses: actions/github-script@v6
         with:
           github-token: ${{secrets.GITHUB_TOKEN}}
           script: |
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 19ba12fd..59f6b717 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -19,15 +19,14 @@ jobs:
         go: ['1.18']
     steps:
       - name: checkout
-        uses: actions/checkout@v2
+        uses: actions/checkout@v3
       - name: validate tag
-        id: validate_tag
         run: |
           tag=`git describe --exact-match --tags 2> /dev/null`
           if [[ $tag =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-rc[0-9]+)?$ ]]; then
               echo "$tag is a valid release tag"
               set -e
-              echo "::set-output name=tag::$tag"
+              echo "tag=$tag" >> $GITHUB_ENV
           else
               echo "$tag is NOT a valid release tag"
               exit 1
@@ -35,11 +34,11 @@ jobs:
       - name: install make
         run: sudo apt-get install make
       - name: set up go 1.x
-        uses: actions/setup-go@v2
+        uses: actions/setup-go@v3
         with:
           go-version: ${{ matrix.go }}
       - name: build images
-        run: SW_VERSION="${{ steps.validate_tag.outputs.tag }}" make image-build
+        run: SW_VERSION="${{ env.tag }}" make image-build
       - name: podman login to quay.io
         uses: redhat-actions/podman-login@v1
         with:
@@ -51,7 +50,7 @@ jobs:
         uses: redhat-actions/push-to-registry@v2
         with:
           image: ${{ env.IMAGE }}
-          tags: ${{ steps.validate_tag.outputs.tag }}
+          tags: ${{ env.tag }}
           registry: ${{ env.REGISTRY }}
       - name: print image url
         run: echo "Image pushed to ${{ steps.push-to-quay.outputs.registry-paths }}"
-- 
GitLab