I want to create a step in the job which will output multiple file names which then could be iterated in another step. Here is my test workflow:
name: test-workflow
on:
push:
branches: [ master ]
jobs:
test-job:
runs-on: ubuntu-latest
steps:
- name: Checkout this repo
uses: actions/checkout@v2
with:
fetch-depth: 2
- name: Test1
id: test1
run: |
for f in $(ls $GITHUB_WORKSPACE/.github/workflows); do
echo "file: $f"
echo "::set-output name=f::$f"
done
- name: Test2
run: |
for file in "${{ steps.test1.outputs.f }}"; do
echo "$file detected"
done
However, given $GITHUB_WORKSPACE/.github/workflows really contains multiple files (all committed to repo), step Test2 prints out only last file name listed in the step Test1 by ls.
How can I set output f from the step Test1 to multiple values?