You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@linkis.apache.org by pe...@apache.org on 2022/09/14 02:45:22 UTC

[incubator-linkis] branch dev-1.3.0 updated: [ISSUE-3315]Add create auto code format pr (#3316)

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

peacewong pushed a commit to branch dev-1.3.0
in repository https://gitbox.apache.org/repos/asf/incubator-linkis.git


The following commit(s) were added to refs/heads/dev-1.3.0 by this push:
     new 024bac47a [ISSUE-3315]Add create auto code format pr (#3316)
024bac47a is described below

commit 024bac47aa2198f6ea3862e71f621ade21174b8c
Author: Casion <ca...@gmail.com>
AuthorDate: Wed Sep 14 10:45:16 2022 +0800

    [ISSUE-3315]Add create auto code format pr (#3316)
    
    * add create auto code format pr
---
 .github/workflows/auto-format-pr.yaml | 70 +++++++++++++++++++++++++++++++++++
 pom.xml                               |  1 -
 2 files changed, 70 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/auto-format-pr.yaml b/.github/workflows/auto-format-pr.yaml
new file mode 100644
index 000000000..dd79a9995
--- /dev/null
+++ b/.github/workflows/auto-format-pr.yaml
@@ -0,0 +1,70 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+name: Create Code Format Apply PullRequest
+
+on:
+  pull_request:
+    branches: [dev,dev-*]
+    types: [closed]
+
+jobs:
+  auto-code-format:
+    if: ${{ startsWith(github.repository, 'apache/') }}
+
+    runs-on: ubuntu-latest
+    env:
+      BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
+      SHA: ${{ github.sha }}
+
+    steps:
+
+      - name: Checkout
+        uses: actions/checkout@v3
+        if: github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true
+
+      - name: Set up JDK 8
+        uses: actions/setup-java@v2
+        with:
+          java-version: '8'
+          distribution: 'adopt'
+
+      - name: Code Format Apply
+        run: |
+          ./mvnw -N install
+          ./mvnw spotless:apply
+
+      - name: Create Pull Request
+        uses: peter-evans/create-pull-request@v4.1.1
+        with:
+          token: ${{ secrets.GITHUB_TOKEN }}
+          branch: ${{ env.BRANCH_NAME }}-${{ env.SHA }}
+          base: ${{ env.BRANCH_NAME }}
+          commit-message: code format apply
+          committer: GitHub <no...@github.com>
+          author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
+          signoff: false
+          delete-branch: true
+
+          title: '[Code] Code format apply'
+          body: |
+            ## Code format apply
+            - run the result of mvn spotless:apply
+
+          labels: |
+            code format
+            automated pr
diff --git a/pom.xml b/pom.xml
index a7e6861f3..94fbbeebd 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1230,7 +1230,6 @@
               <goals>
                 <goal>check</goal>
               </goals>
-              <phase>validate</phase>
             </execution>
           </executions>
         </plugin>


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@linkis.apache.org
For additional commands, e-mail: commits-help@linkis.apache.org