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

urfree pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/pulsar-site.git


The following commit(s) were added to refs/heads/main by this push:
     new 9fb6e4c  update
9fb6e4c is described below

commit 9fb6e4cea45cda2bc30f3c136bf2eb804ae49283
Author: LiLi <[email protected]>
AuthorDate: Wed Jan 26 17:20:20 2022 +0800

    update
    
    Signed-off-by: LiLi <[email protected]>
---
 .github/actions/changed-files/action.yml           | 76 ++++++++++++++++------
 .../workflows/ci-pulsar-website-next-build.yaml    |  2 +-
 2 files changed, 57 insertions(+), 21 deletions(-)

diff --git a/.github/actions/changed-files/action.yml 
b/.github/actions/changed-files/action.yml
index 58ac1b7..b5e38dc 100644
--- a/.github/actions/changed-files/action.yml
+++ b/.github/actions/changed-files/action.yml
@@ -33,6 +33,18 @@ inputs:
   path:
     description: 'Specify a relative path under $GITHUB_WORKSPACE to locate 
the repository'
     required: false
+  files-separator:
+    description: 'Separator used to split the files input'
+    default: " "
+    required: false
+  follow-symbolic-links:
+    description: 'Indicates whether to follow symbolic links'
+    default: "true"
+    required: false
+  strip-top-level-dir:
+    description: 'Strip the `$GITHUB_WORKSPACE` from the paths output'
+    required: false
+    default: "true"
 
 outputs:
   added_files:
@@ -95,6 +107,9 @@ outputs:
   other_deleted_files:
     description: Return list of deleted files not listed in the files input.
     value: ${{ steps.changed-files.outputs.other_deleted_files }}
+  paths:
+    description: "List of filtered paths using the specified patterns and 
separator"
+    value: ${{ steps.glob.outputs.paths }}
 
 runs:
   using: 'composite'
@@ -121,29 +136,50 @@ runs:
         # 
https://github.community/t/input-variable-name-is-not-available-in-composite-run-steps/127611
         INPUT_FILES: ${{ inputs.files }}
         INPUT_FILES_FROM_SOURCE_FILE: ${{ inputs.files_from_source_file }}
-    - name: Glob match
-      uses: .github/actions/glob
+    # - name: Glob match
+    #   uses: .github/actions/glob
+    #   id: glob
+    #   with:
+    #     files: ${{ steps.source-input-files.outputs.files }}
+    #     files-separator: " "
+    #     separator: "|"
+    - name: Get matching files
+      uses: actions/github-script@v5
       id: glob
       with:
-        files: ${{ steps.source-input-files.outputs.files }}
-        files-separator: " "
-        separator: "|"
-    - run: |
-        bash $GITHUB_ACTION_PATH/entrypoint.sh
-      id: changed-files
-      shell: bash
+        github-token: ${{ inputs.token }}
+        script: |
+          const path = require("path");
+         
+          const { GITHUB_ACTION_PATH } = process.env
+          const ACTION_PATH = path.join(GITHUB_ACTION_PATH, "main.js")
+          
+          const main = require(ACTION_PATH)
+          await main({ core, glob })
       env:
-        GITHUB_SERVER_URL: ${{ github.server_url }}
-        GITHUB_REPOSITORY: ${{ github.repository }}
-        GITHUB_BASE_REF: ${{ github.base_ref }}
-        # INPUT_<VARIABLE_NAME> is not available in Composite run steps
-        # 
https://github.community/t/input-variable-name-is-not-available-in-composite-run-steps/127611
-        INPUT_SHA: ${{ inputs.sha }}
-        INPUT_BASE_SHA: ${{ steps.base-sha.outputs.base_sha }}
-        INPUT_TOKEN: ${{ inputs.token }}
-        INPUT_FILES_PATTERN: ${{ steps.glob.outputs.paths }}
-        INPUT_SEPARATOR: ${{ inputs.separator }}
-        INPUT_PATH: ${{ inputs.path }}
+          GITHUB_ACTION_PATH: ${{ github.action_path }}
+          GITHUB_WORKSPACE: ${{ github.workspace }}
+          INPUT_FILES: ${{ inputs.files }}
+          INPUT_FILES_SEPARATOR: ${{ inputs.files-separator }}
+          INPUT_FOLLOW_SYMBOLIC_LINKS: ${{ inputs.follow-symbolic-links }}
+          INPUT_SEPARATOR: ${{ inputs.separator }}
+          INPUT_STRIP_TOP_LEVEL_DIR: ${{ inputs.strip-top-level-dir }}
+      - run: |
+          bash $GITHUB_ACTION_PATH/entrypoint.sh
+        id: changed-files
+        shell: bash
+        env:
+          GITHUB_SERVER_URL: ${{ github.server_url }}
+          GITHUB_REPOSITORY: ${{ github.repository }}
+          GITHUB_BASE_REF: ${{ github.base_ref }}
+          # INPUT_<VARIABLE_NAME> is not available in Composite run steps
+          # 
https://github.community/t/input-variable-name-is-not-available-in-composite-run-steps/127611
+          INPUT_SHA: ${{ inputs.sha }}
+          INPUT_BASE_SHA: ${{ steps.base-sha.outputs.base_sha }}
+          INPUT_TOKEN: ${{ inputs.token }}
+          INPUT_FILES_PATTERN: ${{ steps.glob.outputs.paths }}
+          INPUT_SEPARATOR: ${{ inputs.separator }}
+          INPUT_PATH: ${{ inputs.path }}
 
 branding:
   icon: file-text
diff --git a/.github/workflows/ci-pulsar-website-next-build.yaml 
b/.github/workflows/ci-pulsar-website-next-build.yaml
index 4685a50..f492025 100644
--- a/.github/workflows/ci-pulsar-website-next-build.yaml
+++ b/.github/workflows/ci-pulsar-website-next-build.yaml
@@ -46,7 +46,7 @@ jobs:
       #     echo $CHANGED_FILES
 
       - name: Get changed files
-        uses: .github/actions/changed-files
+        uses: ./.github/actions/changed-files
         with:
           token: ${{ secrets.PULSARBOT_TOKEN }}
 

Reply via email to