This is an automated email from the ASF dual-hosted git repository.

franztt pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/openserverless-operator.git

commit 29a4251588738e3f7ab3f05068c873a33a284e0e
Author: francescotimperi <[email protected]>
AuthorDate: Wed Jul 24 18:24:24 2024 +0000

    chore: added TAG extraction steps
---
 .github/workflows/image.yml | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/image.yml b/.github/workflows/image.yml
index 5157287..2af8c8a 100644
--- a/.github/workflows/image.yml
+++ b/.github/workflows/image.yml
@@ -37,6 +37,8 @@ on:
     - '[0-9]*'
     branches-ignore:
     - '*'
+  pull_request:
+    branches: [main]    
 
 jobs:
   image:
@@ -52,7 +54,15 @@ jobs:
         with:
           submodules: recursive
       - name: License
-        uses: apache/skywalking-eyes@main      
+        uses: apache/skywalking-eyes@main
+      - name: Assign TAG from pull request
+        if:  ${{ github.event_name == 'pull_request' }}
+        run: |
+          echo "IMG_TAG=$(git rev-parse --short HEAD)" >> "$GITHUB_ENV"
+      - name: Assign TAG from push
+        if:  ${{ github.event_name != 'pull_request' }}
+        run: |
+          echo "IMG_TAG=$(git describe --tags --abbrev=0)" >> "$GITHUB_ENV"    
          
       - name: Registry login
         uses: docker/login-action@v3
         with:
@@ -68,4 +78,4 @@ jobs:
         with:
           version: latest
       - name: Image
-        run: task buildx-and-push
\ No newline at end of file
+        run: task buildx-and-push TAG="$IMG_TAG"
\ No newline at end of file

Reply via email to