mirror of
https://github.com/pyTooling/Actions.git
synced 2026-02-12 02:56:56 +08:00
set glob recursive=True
This commit is contained in:
19
.github/workflows/test.yml
vendored
19
.github/workflows/test.yml
vendored
@@ -18,7 +18,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- run: echo "Build some tool and generate some (versioned) artifacts" > artifact-$(date -u +"%Y-%m-%dT%H-%M-%SZ").txt
|
- run: echo "Build some tool and generate some (versioned) artifacts" > artifact-$(date -u +"%Y-%m-%dT%H-%M-%SZ").txt
|
||||||
|
|
||||||
- name: Single
|
- name: Single
|
||||||
@@ -36,7 +36,8 @@ jobs:
|
|||||||
artifact-*.txt
|
artifact-*.txt
|
||||||
README.md
|
README.md
|
||||||
|
|
||||||
- run: |
|
- name: Add artifacts/artifact.txt
|
||||||
|
run: |
|
||||||
mkdir artifacts
|
mkdir artifacts
|
||||||
echo "Build some tool and generate some artifacts" > artifacts/artifact.txt
|
echo "Build some tool and generate some artifacts" > artifacts/artifact.txt
|
||||||
|
|
||||||
@@ -46,7 +47,8 @@ jobs:
|
|||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
files: artifacts/artifact.txt
|
files: artifacts/artifact.txt
|
||||||
|
|
||||||
- run: |
|
- name: Add artifacts/*.md
|
||||||
|
run: |
|
||||||
echo "tip hello" > artifacts/hello.md
|
echo "tip hello" > artifacts/hello.md
|
||||||
echo "tip world" > artifacts/world.md
|
echo "tip world" > artifacts/world.md
|
||||||
|
|
||||||
@@ -55,3 +57,14 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
files: artifacts/*
|
files: artifacts/*
|
||||||
|
|
||||||
|
- name: Add artifacts/subdir
|
||||||
|
run: |
|
||||||
|
mkdir artifacts/subdir
|
||||||
|
echo "Test recursive glob" > artifacts/subdir/deep_file.txt
|
||||||
|
|
||||||
|
- name: Directory wildcard (recursive)
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
files: artifacts/**
|
||||||
|
|||||||
2
tip.py
2
tip.py
@@ -25,7 +25,7 @@ if len(args) == 0:
|
|||||||
raise(Exception("Glob patterns need to be provided as positional arguments or through envvar 'INPUT_FILES'!"))
|
raise(Exception("Glob patterns need to be provided as positional arguments or through envvar 'INPUT_FILES'!"))
|
||||||
|
|
||||||
for item in args:
|
for item in args:
|
||||||
items = glob(item)
|
items = [fname for fname in glob(item, recursive=True) if not Path(fname).is_dir()]
|
||||||
print("glob(%s)" % item, "->", items)
|
print("glob(%s)" % item, "->", items)
|
||||||
files = files + items
|
files = files + items
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user