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:
17
.github/workflows/test.yml
vendored
17
.github/workflows/test.yml
vendored
@@ -36,7 +36,8 @@ jobs:
|
||||
artifact-*.txt
|
||||
README.md
|
||||
|
||||
- run: |
|
||||
- name: Add artifacts/artifact.txt
|
||||
run: |
|
||||
mkdir artifacts
|
||||
echo "Build some tool and generate some artifacts" > artifacts/artifact.txt
|
||||
|
||||
@@ -46,7 +47,8 @@ jobs:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
files: artifacts/artifact.txt
|
||||
|
||||
- run: |
|
||||
- name: Add artifacts/*.md
|
||||
run: |
|
||||
echo "tip hello" > artifacts/hello.md
|
||||
echo "tip world" > artifacts/world.md
|
||||
|
||||
@@ -55,3 +57,14 @@ jobs:
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
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'!"))
|
||||
|
||||
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)
|
||||
files = files + items
|
||||
|
||||
|
||||
Reference in New Issue
Block a user