You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by la...@apache.org on 2021/06/16 02:32:45 UTC

[dubbo-go] branch 3.0 updated: Fix: use `if` conditions to determine git event type (#1252)

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

laurence pushed a commit to branch 3.0
in repository https://gitbox.apache.org/repos/asf/dubbo-go.git


The following commit(s) were added to refs/heads/3.0 by this push:
     new fb608c5  Fix: use `if` conditions to determine git event type (#1252)
fb608c5 is described below

commit fb608c5545a0178b476d72b4b737c74055d482ed
Author: EnableAsync <43...@users.noreply.github.com>
AuthorDate: Wed Jun 16 10:32:37 2021 +0800

    Fix: use `if` conditions to determine git event type (#1252)
    
    * fix: github-action.yml
    
    * fix: github-action.yml
    
    * fix: fmt files
---
 .github/workflows/github-actions.yml | 13 ++++++++++---
 metadata/report/etcd/report.go       |  4 ++--
 2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml
index 64b0621..952e58d 100644
--- a/.github/workflows/github-actions.yml
+++ b/.github/workflows/github-actions.yml
@@ -7,7 +7,6 @@ on:
     branches: "*"
 
 jobs:
-
   build:
     name: ${{ matrix.os }} - Go ${{ matrix.go_version }}
     runs-on: ${{ matrix.os }}
@@ -69,12 +68,20 @@ jobs:
       run: |
         make verify
 
+    # This step only runs when the event type is a pull_request
+    - name: Integrate Test
+      if: ${{ github.event_name == 'pull_request' }}
+      run: |
+        chmod +x integrate_test.sh && [[ -n "${{github.event.pull_request.head.repo.full_name}}" ]] && [[ -n "${{github.event.pull_request.head.sha}}" ]] && [[ -n "${{github.base_ref}}" ]] && ./integrate_test.sh ${{github.event.pull_request.head.repo.full_name}} ${{github.event.pull_request.head.sha}} ${{github.base_ref}}
+
+    # This step only runs when the event type is a push
     - name: Integrate Test
+      if: ${{ github.event_name == 'push' }}
       run: |
-        chmod +x integrate_test.sh && [[ -n "${{github.event.pull_request.head.repo.full_name}}" ]] && [[ -n "${{github.event.pull_request.head.sha}}" ]] && [[ -n "${{github.base_ref}}" ]] && ./integrate_test.sh ${{github.event.pull_request.head.repo.full_name}} ${{github.event.pull_request.head.sha}} ${{github.base_ref}} || ./integrate_test.sh $GITHUB_REPOSITORY $GITHUB_SHA $GITHUB_BASE_REF
+        chmod +x integrate_test.sh && ./integrate_test.sh $GITHUB_REPOSITORY $GITHUB_SHA $GITHUB_BASE_REF
 
     - name: Post Coverage
       run: bash <(curl -s https://codecov.io/bash)
 
     - name: Hello world
-      run: echo Hello world ${{ secrets.DING_TOKEN }} ${{ secrets.DING_SIGN }}
\ No newline at end of file
+      run: echo Hello world ${{ secrets.DING_TOKEN }} ${{ secrets.DING_SIGN }}
diff --git a/metadata/report/etcd/report.go b/metadata/report/etcd/report.go
index bec551c..836b43b 100644
--- a/metadata/report/etcd/report.go
+++ b/metadata/report/etcd/report.go
@@ -58,7 +58,7 @@ func (e *etcdMetadataReport) GetAppMetadata(metadataIdentifier *identifier.Subsc
 	if err != nil {
 		return nil, err
 	}
-	
+
 	info := &common.MetadataInfo{}
 	return info, json.Unmarshal([]byte(data), info)
 }
@@ -70,7 +70,7 @@ func (e *etcdMetadataReport) PublishAppMetadata(metadataIdentifier *identifier.S
 	if err == nil {
 		err = e.client.Put(key, string(value))
 	}
-	
+
 	return err
 }