File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # Workflow to test upload-artifact action with 501 files in a single upload
2+ # This tests the 500 file limit mentioned in https://github.com/actions/upload-artifact
3+
4+ name : Upload Artifact Test - Single Upload
5+
6+ # Controls when the action will run. Workflow runs when manually triggered using the UI or API.
7+ on :
8+ workflow_dispatch :
9+
10+ jobs :
11+ test-single-upload :
12+ name : Test uploading 501 files in a single upload-artifact step
13+ runs-on : ubuntu-latest
14+ permissions :
15+ contents : read
16+
17+ steps :
18+ - name : Create 501 test files
19+ run : |
20+ mkdir -p test-files
21+ for i in {1..501}; do
22+ echo "This is test file number $i" > test-files/file-$i.txt
23+ done
24+ echo "Created $(ls test-files | wc -l) files"
25+
26+ - name : Upload all 501 files in a single step
27+ uses : actions/upload-artifact@v4
28+ with :
29+ name : test-501-files-single-upload
30+ path : test-files/
Original file line number Diff line number Diff line change 1+ # Workflow to test upload-artifact action with 501 files split into 2 uploads
2+ # This tests the 500 file limit mentioned in https://github.com/actions/upload-artifact
3+
4+ name : Upload Artifact Test - Split Upload
5+
6+ # Controls when the action will run. Workflow runs when manually triggered using the UI or API.
7+ on :
8+ workflow_dispatch :
9+
10+ jobs :
11+ test-split-upload :
12+ name : Test uploading 501 files in two separate upload-artifact steps
13+ runs-on : ubuntu-latest
14+ permissions :
15+ contents : read
16+
17+ steps :
18+ - name : Create 501 test files
19+ run : |
20+ mkdir -p test-files
21+ for i in {1..501}; do
22+ echo "This is test file number $i" > test-files/file-$i.txt
23+ done
24+ echo "Created $(ls test-files | wc -l) files"
25+
26+ - name : Create directories for split upload
27+ run : |
28+ mkdir -p test-files-part1 test-files-part2
29+ for i in {1..250}; do
30+ cp test-files/file-$i.txt test-files-part1/
31+ done
32+ for i in {251..501}; do
33+ cp test-files/file-$i.txt test-files-part2/
34+ done
35+ echo "Part 1 has $(ls test-files-part1 | wc -l) files"
36+ echo "Part 2 has $(ls test-files-part2 | wc -l) files"
37+
38+ - name : Upload files 1-250
39+ uses : actions/upload-artifact@v4
40+ with :
41+ name : test-501-files-split-upload-part1
42+ path : test-files-part1/
43+
44+ - name : Upload files 251-501
45+ uses : actions/upload-artifact@v4
46+ with :
47+ name : test-501-files-split-upload-part2
48+ path : test-files-part2/
Original file line number Diff line number Diff line change 1+ # Workflow to test upload-artifact action with 501 files zipped into a single file
2+ # This tests the 500 file limit mentioned in https://github.com/actions/upload-artifact
3+
4+ name : Upload Artifact Test - Zipped Upload
5+
6+ # Controls when the action will run. Workflow runs when manually triggered using the UI or API.
7+ on :
8+ workflow_dispatch :
9+
10+ jobs :
11+ test-zipped-upload :
12+ name : Test uploading 501 files as a single zip file
13+ runs-on : ubuntu-latest
14+ permissions :
15+ contents : read
16+
17+ steps :
18+ - name : Create 501 test files
19+ run : |
20+ mkdir -p test-files
21+ for i in {1..501}; do
22+ echo "This is test file number $i" > test-files/file-$i.txt
23+ done
24+ echo "Created $(ls test-files | wc -l) files"
25+
26+ - name : Zip all files
27+ run : |
28+ zip -r test-files.zip test-files/
29+ echo "Zip file created: $(ls -lh test-files.zip)"
30+
31+ - name : Upload zip file
32+ uses : actions/upload-artifact@v4
33+ with :
34+ name : test-501-files-zipped
35+ path : test-files.zip
You can’t perform that action at this time.
0 commit comments