mirror of
https://github.com/actions/upload-artifact.git
synced 2025-06-14 15:57:12 +02:00
Compare commits
10 Commits
jtamsut/up
...
v3
Author | SHA1 | Date | |
---|---|---|---|
ff15f0306b | |||
87b9624c21 | |||
9ee08a3b00 | |||
ff37344dc2 | |||
d99c5eca07 | |||
afc7e4a27d | |||
a8a3f3ad30 | |||
7b48769c03 | |||
66630398df | |||
55e76b779d |
32
.licenses/npm/@actions/artifact.dep.yml
generated
32
.licenses/npm/@actions/artifact.dep.yml
generated
@ -1,30 +1,20 @@
|
|||||||
---
|
---
|
||||||
name: "@actions/artifact"
|
name: "@actions/artifact"
|
||||||
version: 1.1.1
|
version: 1.1.2
|
||||||
type: npm
|
type: npm
|
||||||
summary:
|
summary: Actions artifact lib
|
||||||
homepage:
|
homepage: https://github.com/actions/toolkit/tree/main/packages/artifact
|
||||||
license: mit
|
license: mit
|
||||||
licenses:
|
licenses:
|
||||||
- sources: Auto-generated MIT license text
|
- sources: LICENSE.md
|
||||||
text: |
|
text: |-
|
||||||
MIT License
|
The MIT License (MIT)
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Copyright 2019 GitHub
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
SOFTWARE.
|
|
||||||
notices: []
|
notices: []
|
||||||
|
4
.licenses/npm/@actions/http-client.dep.yml
generated
4
.licenses/npm/@actions/http-client.dep.yml
generated
@ -1,9 +1,9 @@
|
|||||||
---
|
---
|
||||||
name: "@actions/http-client"
|
name: "@actions/http-client"
|
||||||
version: 1.0.11
|
version: 2.0.1
|
||||||
type: npm
|
type: npm
|
||||||
summary: Actions Http Client
|
summary: Actions Http Client
|
||||||
homepage: https://github.com/actions/http-client#readme
|
homepage: https://github.com/actions/toolkit/tree/main/packages/http-client
|
||||||
license: mit
|
license: mit
|
||||||
licenses:
|
licenses:
|
||||||
- sources: LICENSE
|
- sources: LICENSE
|
||||||
|
26
.licenses/npm/@types/tmp.dep.yml
generated
26
.licenses/npm/@types/tmp.dep.yml
generated
@ -1,26 +0,0 @@
|
|||||||
---
|
|
||||||
name: "@types/tmp"
|
|
||||||
version: 0.1.0
|
|
||||||
type: npm
|
|
||||||
summary: TypeScript definitions for tmp
|
|
||||||
homepage: https://github.com/DefinitelyTyped/DefinitelyTyped#readme
|
|
||||||
license: mit
|
|
||||||
licenses:
|
|
||||||
- sources: LICENSE
|
|
||||||
text: " MIT License\r\n\r\n Copyright (c) Microsoft Corporation. All rights
|
|
||||||
reserved.\r\n\r\n Permission is hereby granted, free of charge, to any person
|
|
||||||
obtaining a copy\r\n of this software and associated documentation files (the
|
|
||||||
\"Software\"), to deal\r\n in the Software without restriction, including without
|
|
||||||
limitation the rights\r\n to use, copy, modify, merge, publish, distribute,
|
|
||||||
sublicense, and/or sell\r\n copies of the Software, and to permit persons to
|
|
||||||
whom the Software is\r\n furnished to do so, subject to the following conditions:\r\n\r\n
|
|
||||||
\ The above copyright notice and this permission notice shall be included in
|
|
||||||
all\r\n copies or substantial portions of the Software.\r\n\r\n THE SOFTWARE
|
|
||||||
IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\n IMPLIED,
|
|
||||||
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n FITNESS
|
|
||||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\n AUTHORS
|
|
||||||
OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\n LIABILITY,
|
|
||||||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\n OUT
|
|
||||||
OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r\n
|
|
||||||
\ SOFTWARE\r\n"
|
|
||||||
notices: []
|
|
4
.licenses/npm/glob.dep.yml
generated
4
.licenses/npm/glob.dep.yml
generated
@ -1,9 +1,9 @@
|
|||||||
---
|
---
|
||||||
name: glob
|
name: glob
|
||||||
version: 7.1.6
|
version: 7.2.3
|
||||||
type: npm
|
type: npm
|
||||||
summary: a little globber
|
summary: a little globber
|
||||||
homepage: https://github.com/isaacs/node-glob#readme
|
homepage:
|
||||||
license: isc
|
license: isc
|
||||||
licenses:
|
licenses:
|
||||||
- sources: LICENSE
|
- sources: LICENSE
|
||||||
|
4
.licenses/npm/minimatch.dep.yml
generated
4
.licenses/npm/minimatch.dep.yml
generated
@ -1,9 +1,9 @@
|
|||||||
---
|
---
|
||||||
name: minimatch
|
name: minimatch
|
||||||
version: 3.0.4
|
version: 3.1.2
|
||||||
type: npm
|
type: npm
|
||||||
summary: a glob matcher in javascript
|
summary: a glob matcher in javascript
|
||||||
homepage: https://github.com/isaacs/minimatch#readme
|
homepage:
|
||||||
license: isc
|
license: isc
|
||||||
licenses:
|
licenses:
|
||||||
- sources: LICENSE
|
- sources: LICENSE
|
||||||
|
4
.licenses/npm/rimraf.dep.yml
generated
4
.licenses/npm/rimraf.dep.yml
generated
@ -1,9 +1,9 @@
|
|||||||
---
|
---
|
||||||
name: rimraf
|
name: rimraf
|
||||||
version: 2.6.3
|
version: 3.0.2
|
||||||
type: npm
|
type: npm
|
||||||
summary: A deep deletion module for node (like `rm -rf`)
|
summary: A deep deletion module for node (like `rm -rf`)
|
||||||
homepage: https://github.com/isaacs/rimraf#readme
|
homepage:
|
||||||
license: isc
|
license: isc
|
||||||
licenses:
|
licenses:
|
||||||
- sources: LICENSE
|
- sources: LICENSE
|
||||||
|
4
.licenses/npm/tmp-promise.dep.yml
generated
4
.licenses/npm/tmp-promise.dep.yml
generated
@ -1,9 +1,9 @@
|
|||||||
---
|
---
|
||||||
name: tmp-promise
|
name: tmp-promise
|
||||||
version: 2.1.1
|
version: 3.0.3
|
||||||
type: npm
|
type: npm
|
||||||
summary: The tmp package with promises support and disposers.
|
summary: The tmp package with promises support and disposers.
|
||||||
homepage: https://github.com/benjamingr/tmp-promise#readme
|
homepage:
|
||||||
license: mit
|
license: mit
|
||||||
licenses:
|
licenses:
|
||||||
- sources: Auto-generated MIT license text
|
- sources: Auto-generated MIT license text
|
||||||
|
2
.licenses/npm/tmp.dep.yml
generated
2
.licenses/npm/tmp.dep.yml
generated
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: tmp
|
name: tmp
|
||||||
version: 0.1.0
|
version: 0.2.1
|
||||||
type: npm
|
type: npm
|
||||||
summary: Temporary file and directory creator
|
summary: Temporary file and directory creator
|
||||||
homepage: http://github.com/raszi/node-tmp
|
homepage: http://github.com/raszi/node-tmp
|
||||||
|
20
.licenses/npm/uuid.dep.yml
generated
Normal file
20
.licenses/npm/uuid.dep.yml
generated
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
---
|
||||||
|
name: uuid
|
||||||
|
version: 8.3.2
|
||||||
|
type: npm
|
||||||
|
summary: RFC4122 (v1, v4, and v5) UUIDs
|
||||||
|
homepage:
|
||||||
|
license: mit
|
||||||
|
licenses:
|
||||||
|
- sources: LICENSE.md
|
||||||
|
text: |
|
||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright (c) 2010-2020 Robert Kieffer and other contributors
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
notices: []
|
23
README.md
23
README.md
@ -237,6 +237,29 @@ Artifacts are retained for 90 days by default. You can specify a shorter retenti
|
|||||||
|
|
||||||
The retention period must be between 1 and 90 inclusive. For more information see [artifact and log retention policies](https://docs.github.com/en/free-pro-team@latest/actions/reference/usage-limits-billing-and-administration#artifact-and-log-retention-policy).
|
The retention period must be between 1 and 90 inclusive. For more information see [artifact and log retention policies](https://docs.github.com/en/free-pro-team@latest/actions/reference/usage-limits-billing-and-administration#artifact-and-log-retention-policy).
|
||||||
|
|
||||||
|
|
||||||
|
### Hidden Files
|
||||||
|
|
||||||
|
By default, hidden files are ignored by this action to avoid unintentionally uploading sensitive information.
|
||||||
|
|
||||||
|
In versions of this action before v3.2.0, these hidden files were included by default.
|
||||||
|
|
||||||
|
If you need to upload hidden files, you can use the `include-hidden-files` input.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
jobs:
|
||||||
|
upload:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Create a Hidden File
|
||||||
|
run: echo "hello from a hidden file" > .hidden-file.txt
|
||||||
|
- name: Upload Artifact
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
path: .hidden-file.txt
|
||||||
|
include-hidden-files: true
|
||||||
|
```
|
||||||
|
|
||||||
## Where does the upload go?
|
## Where does the upload go?
|
||||||
|
|
||||||
At the bottom of the workflow summary page, there is a dedicated section for artifacts. Here's a screenshot of something you might see:
|
At the bottom of the workflow summary page, there is a dedicated section for artifacts. Here's a screenshot of something you might see:
|
||||||
|
@ -61,6 +61,20 @@ const lonelyFilePath = path.join(
|
|||||||
'lonely-file.txt'
|
'lonely-file.txt'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const hiddenFile = path.join(root, '.hidden-file.txt')
|
||||||
|
const fileInHiddenFolderPath = path.join(
|
||||||
|
root,
|
||||||
|
'.hidden-folder',
|
||||||
|
'folder-in-hidden-folder',
|
||||||
|
'file.txt'
|
||||||
|
)
|
||||||
|
const fileInHiddenFolderInFolderA = path.join(
|
||||||
|
root,
|
||||||
|
'folder-a',
|
||||||
|
'.hidden-folder-in-folder-a',
|
||||||
|
'file.txt'
|
||||||
|
)
|
||||||
|
|
||||||
describe('Search', () => {
|
describe('Search', () => {
|
||||||
beforeAll(async () => {
|
beforeAll(async () => {
|
||||||
// mock all output so that there is less noise when running tests
|
// mock all output so that there is less noise when running tests
|
||||||
@ -92,6 +106,13 @@ describe('Search', () => {
|
|||||||
await fs.mkdir(path.join(root, 'folder-h', 'folder-j', 'folder-k'), {
|
await fs.mkdir(path.join(root, 'folder-h', 'folder-j', 'folder-k'), {
|
||||||
recursive: true
|
recursive: true
|
||||||
})
|
})
|
||||||
|
await fs.mkdir(
|
||||||
|
path.join(root, '.hidden-folder', 'folder-in-hidden-folder'),
|
||||||
|
{recursive: true}
|
||||||
|
)
|
||||||
|
await fs.mkdir(path.join(root, 'folder-a', '.hidden-folder-in-folder-a'), {
|
||||||
|
recursive: true
|
||||||
|
})
|
||||||
|
|
||||||
await fs.writeFile(searchItem1Path, 'search item1 file')
|
await fs.writeFile(searchItem1Path, 'search item1 file')
|
||||||
await fs.writeFile(searchItem2Path, 'search item2 file')
|
await fs.writeFile(searchItem2Path, 'search item2 file')
|
||||||
@ -110,10 +131,19 @@ describe('Search', () => {
|
|||||||
await fs.writeFile(amazingFileInFolderHPath, 'amazing file')
|
await fs.writeFile(amazingFileInFolderHPath, 'amazing file')
|
||||||
|
|
||||||
await fs.writeFile(lonelyFilePath, 'all by itself')
|
await fs.writeFile(lonelyFilePath, 'all by itself')
|
||||||
|
|
||||||
|
await fs.writeFile(hiddenFile, 'hidden file')
|
||||||
|
await fs.writeFile(fileInHiddenFolderPath, 'file in hidden directory')
|
||||||
|
await fs.writeFile(fileInHiddenFolderInFolderA, 'file in hidden directory')
|
||||||
/*
|
/*
|
||||||
Directory structure of files that get created:
|
Directory structure of files that get created:
|
||||||
root/
|
root/
|
||||||
|
.hidden-folder/
|
||||||
|
folder-in-hidden-folder/
|
||||||
|
file.txt
|
||||||
folder-a/
|
folder-a/
|
||||||
|
.hidden-folder-in-folder-a/
|
||||||
|
file.txt
|
||||||
folder-b/
|
folder-b/
|
||||||
folder-c/
|
folder-c/
|
||||||
search-item1.txt
|
search-item1.txt
|
||||||
@ -136,6 +166,7 @@ describe('Search', () => {
|
|||||||
folder-j/
|
folder-j/
|
||||||
folder-k/
|
folder-k/
|
||||||
lonely-file.txt
|
lonely-file.txt
|
||||||
|
.hidden-file.txt
|
||||||
search-item5.txt
|
search-item5.txt
|
||||||
*/
|
*/
|
||||||
})
|
})
|
||||||
@ -352,4 +383,24 @@ describe('Search', () => {
|
|||||||
)
|
)
|
||||||
expect(searchResult.filesToUpload.includes(lonelyFilePath)).toEqual(true)
|
expect(searchResult.filesToUpload.includes(lonelyFilePath)).toEqual(true)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('Hidden files ignored by default', async () => {
|
||||||
|
const searchPath = path.join(root, '**/*')
|
||||||
|
const searchResult = await findFilesToUpload(searchPath)
|
||||||
|
|
||||||
|
expect(searchResult.filesToUpload).not.toContain(hiddenFile)
|
||||||
|
expect(searchResult.filesToUpload).not.toContain(fileInHiddenFolderPath)
|
||||||
|
expect(searchResult.filesToUpload).not.toContain(
|
||||||
|
fileInHiddenFolderInFolderA
|
||||||
|
)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('Hidden files included', async () => {
|
||||||
|
const searchPath = path.join(root, '**/*')
|
||||||
|
const searchResult = await findFilesToUpload(searchPath, true)
|
||||||
|
|
||||||
|
expect(searchResult.filesToUpload).toContain(hiddenFile)
|
||||||
|
expect(searchResult.filesToUpload).toContain(fileInHiddenFolderPath)
|
||||||
|
expect(searchResult.filesToUpload).toContain(fileInHiddenFolderInFolderA)
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
@ -23,6 +23,11 @@ inputs:
|
|||||||
|
|
||||||
Minimum 1 day.
|
Minimum 1 day.
|
||||||
Maximum 90 days unless changed from the repository settings page.
|
Maximum 90 days unless changed from the repository settings page.
|
||||||
|
include-hidden-files:
|
||||||
|
description: >
|
||||||
|
If true, hidden files will be included in the uploaded artifact.
|
||||||
|
If false, hidden files will be excluded from the uploaded artifact.
|
||||||
|
default: 'false'
|
||||||
runs:
|
runs:
|
||||||
using: 'node16'
|
using: 'node16'
|
||||||
main: 'dist/index.js'
|
main: 'dist/index.js'
|
||||||
|
462
dist/index.js
vendored
462
dist/index.js
vendored
File diff suppressed because it is too large
Load Diff
32
package-lock.json
generated
32
package-lock.json
generated
@ -9,9 +9,9 @@
|
|||||||
"version": "3.0.0",
|
"version": "3.0.0",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/artifact": "^1.1.1",
|
"@actions/artifact": "^1.1.2",
|
||||||
"@actions/core": "^1.10.0",
|
"@actions/core": "^1.10.0",
|
||||||
"@actions/glob": "^0.3.0",
|
"@actions/glob": "^0.5.0",
|
||||||
"@actions/io": "^1.1.2"
|
"@actions/io": "^1.1.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
@ -32,9 +32,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@actions/artifact": {
|
"node_modules/@actions/artifact": {
|
||||||
"version": "1.1.1",
|
"version": "1.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/@actions/artifact/-/artifact-1.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/@actions/artifact/-/artifact-1.1.2.tgz",
|
||||||
"integrity": "sha512-Vv4y0EW0ptEkU+Pjs5RGS/0EryTvI6s79LjSV9Gg/h+O3H/ddpjhuX/Bi/HZE4pbNPyjGtQjbdFWphkZhmgabA==",
|
"integrity": "sha512-1gLONA4xw3/Q/9vGxKwkFdV9u1LE2RWGx/IpAqg28ZjprCnJFjwn4pA7LtShqg5mg5WhMek2fjpyH1leCmOlQQ==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.9.1",
|
"@actions/core": "^1.9.1",
|
||||||
"@actions/http-client": "^2.0.1",
|
"@actions/http-client": "^2.0.1",
|
||||||
@ -52,11 +52,11 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@actions/glob": {
|
"node_modules/@actions/glob": {
|
||||||
"version": "0.3.0",
|
"version": "0.5.0",
|
||||||
"resolved": "https://registry.npmjs.org/@actions/glob/-/glob-0.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/@actions/glob/-/glob-0.5.0.tgz",
|
||||||
"integrity": "sha512-tJP1ZhF87fd6LBnaXWlahkyvdgvsLl7WnreW1EZaC8JWjpMXmzqWzQVe/IEYslrkT9ymibVrKyJN4UMD7uQM2w==",
|
"integrity": "sha512-tST2rjPvJLRZLuT9NMUtyBjvj9Yo0MiJS3ow004slMvm8GFM+Zv9HvMJ7HWzfUyJnGrJvDsYkWBaaG3YKXRtCw==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.2.6",
|
"@actions/core": "^1.9.1",
|
||||||
"minimatch": "^3.0.4"
|
"minimatch": "^3.0.4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -6148,9 +6148,9 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/artifact": {
|
"@actions/artifact": {
|
||||||
"version": "1.1.1",
|
"version": "1.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/@actions/artifact/-/artifact-1.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/@actions/artifact/-/artifact-1.1.2.tgz",
|
||||||
"integrity": "sha512-Vv4y0EW0ptEkU+Pjs5RGS/0EryTvI6s79LjSV9Gg/h+O3H/ddpjhuX/Bi/HZE4pbNPyjGtQjbdFWphkZhmgabA==",
|
"integrity": "sha512-1gLONA4xw3/Q/9vGxKwkFdV9u1LE2RWGx/IpAqg28ZjprCnJFjwn4pA7LtShqg5mg5WhMek2fjpyH1leCmOlQQ==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@actions/core": "^1.9.1",
|
"@actions/core": "^1.9.1",
|
||||||
"@actions/http-client": "^2.0.1",
|
"@actions/http-client": "^2.0.1",
|
||||||
@ -6168,11 +6168,11 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@actions/glob": {
|
"@actions/glob": {
|
||||||
"version": "0.3.0",
|
"version": "0.5.0",
|
||||||
"resolved": "https://registry.npmjs.org/@actions/glob/-/glob-0.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/@actions/glob/-/glob-0.5.0.tgz",
|
||||||
"integrity": "sha512-tJP1ZhF87fd6LBnaXWlahkyvdgvsLl7WnreW1EZaC8JWjpMXmzqWzQVe/IEYslrkT9ymibVrKyJN4UMD7uQM2w==",
|
"integrity": "sha512-tST2rjPvJLRZLuT9NMUtyBjvj9Yo0MiJS3ow004slMvm8GFM+Zv9HvMJ7HWzfUyJnGrJvDsYkWBaaG3YKXRtCw==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@actions/core": "^1.2.6",
|
"@actions/core": "^1.9.1",
|
||||||
"minimatch": "^3.0.4"
|
"minimatch": "^3.0.4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -29,9 +29,9 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://github.com/actions/upload-artifact#readme",
|
"homepage": "https://github.com/actions/upload-artifact#readme",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/artifact": "^1.1.1",
|
"@actions/artifact": "^1.1.2",
|
||||||
"@actions/core": "^1.10.0",
|
"@actions/core": "^1.10.0",
|
||||||
"@actions/glob": "^0.3.0",
|
"@actions/glob": "^0.5.0",
|
||||||
"@actions/io": "^1.1.2"
|
"@actions/io": "^1.1.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
@ -3,7 +3,8 @@ export enum Inputs {
|
|||||||
Name = 'name',
|
Name = 'name',
|
||||||
Path = 'path',
|
Path = 'path',
|
||||||
IfNoFilesFound = 'if-no-files-found',
|
IfNoFilesFound = 'if-no-files-found',
|
||||||
RetentionDays = 'retention-days'
|
RetentionDays = 'retention-days',
|
||||||
|
IncludeHiddenFiles = 'include-hidden-files'
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum NoFileOptions {
|
export enum NoFileOptions {
|
||||||
|
@ -11,6 +11,7 @@ export function getInputs(): UploadInputs {
|
|||||||
|
|
||||||
const ifNoFilesFound = core.getInput(Inputs.IfNoFilesFound)
|
const ifNoFilesFound = core.getInput(Inputs.IfNoFilesFound)
|
||||||
const noFileBehavior: NoFileOptions = NoFileOptions[ifNoFilesFound]
|
const noFileBehavior: NoFileOptions = NoFileOptions[ifNoFilesFound]
|
||||||
|
const includeHiddenFiles = core.getBooleanInput(Inputs.IncludeHiddenFiles)
|
||||||
|
|
||||||
if (!noFileBehavior) {
|
if (!noFileBehavior) {
|
||||||
core.setFailed(
|
core.setFailed(
|
||||||
@ -25,7 +26,8 @@ export function getInputs(): UploadInputs {
|
|||||||
const inputs = {
|
const inputs = {
|
||||||
artifactName: name,
|
artifactName: name,
|
||||||
searchPath: path,
|
searchPath: path,
|
||||||
ifNoFilesFound: noFileBehavior
|
ifNoFilesFound: noFileBehavior,
|
||||||
|
includeHiddenFiles
|
||||||
} as UploadInputs
|
} as UploadInputs
|
||||||
|
|
||||||
const retentionDaysStr = core.getInput(Inputs.RetentionDays)
|
const retentionDaysStr = core.getInput(Inputs.RetentionDays)
|
||||||
|
@ -11,11 +11,12 @@ export interface SearchResult {
|
|||||||
rootDirectory: string
|
rootDirectory: string
|
||||||
}
|
}
|
||||||
|
|
||||||
function getDefaultGlobOptions(): glob.GlobOptions {
|
function getDefaultGlobOptions(includeHiddenFiles: boolean): glob.GlobOptions {
|
||||||
return {
|
return {
|
||||||
followSymbolicLinks: true,
|
followSymbolicLinks: true,
|
||||||
implicitDescendants: true,
|
implicitDescendants: true,
|
||||||
omitBrokenSymbolicLinks: true
|
omitBrokenSymbolicLinks: true,
|
||||||
|
excludeHiddenFiles: !includeHiddenFiles
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -80,12 +81,12 @@ function getMultiPathLCA(searchPaths: string[]): string {
|
|||||||
|
|
||||||
export async function findFilesToUpload(
|
export async function findFilesToUpload(
|
||||||
searchPath: string,
|
searchPath: string,
|
||||||
globOptions?: glob.GlobOptions
|
includeHiddenFiles?: boolean
|
||||||
): Promise<SearchResult> {
|
): Promise<SearchResult> {
|
||||||
const searchResults: string[] = []
|
const searchResults: string[] = []
|
||||||
const globber = await glob.create(
|
const globber = await glob.create(
|
||||||
searchPath,
|
searchPath,
|
||||||
globOptions || getDefaultGlobOptions()
|
getDefaultGlobOptions(includeHiddenFiles || false)
|
||||||
)
|
)
|
||||||
const rawSearchResults: string[] = await globber.glob()
|
const rawSearchResults: string[] = await globber.glob()
|
||||||
|
|
||||||
|
@ -7,7 +7,10 @@ import {NoFileOptions} from './constants'
|
|||||||
async function run(): Promise<void> {
|
async function run(): Promise<void> {
|
||||||
try {
|
try {
|
||||||
const inputs = getInputs()
|
const inputs = getInputs()
|
||||||
const searchResult = await findFilesToUpload(inputs.searchPath)
|
const searchResult = await findFilesToUpload(
|
||||||
|
inputs.searchPath,
|
||||||
|
inputs.includeHiddenFiles
|
||||||
|
)
|
||||||
if (searchResult.filesToUpload.length === 0) {
|
if (searchResult.filesToUpload.length === 0) {
|
||||||
// No files were found, different use cases warrant different types of behavior if nothing is found
|
// No files were found, different use cases warrant different types of behavior if nothing is found
|
||||||
switch (inputs.ifNoFilesFound) {
|
switch (inputs.ifNoFilesFound) {
|
||||||
|
@ -20,4 +20,9 @@ export interface UploadInputs {
|
|||||||
* Duration after which artifact will expire in days
|
* Duration after which artifact will expire in days
|
||||||
*/
|
*/
|
||||||
retentionDays: number
|
retentionDays: number
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether or not to include hidden files in the artifact
|
||||||
|
*/
|
||||||
|
includeHiddenFiles: boolean
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user