Compare commits

..

52 Commits

Author SHA1 Message Date
Rob Herley
ed25d4d912 more debug logs 2023-11-30 22:06:26 -05:00
Rob Herley
db146faf7b tsc & ncc 2023-11-30 21:37:48 -05:00
Rob Herley
6ee005d6b7 adopt new internal artifact api behavior 2023-11-30 21:37:06 -05:00
Rob Herley
896d1bb258 Merge pull request #232 from robherley/v4-beta
[v4-beta] Bump linked artifact toolkit pkg
2023-10-16 14:56:31 -04:00
Rob Herley
57685c7c71 bump linked artifact toolkit pkg 2023-10-16 14:40:44 -04:00
Rob Herley
8c323b340c Merge pull request #226 from robherley/main
Create v4-beta
2023-08-24 12:15:14 -04:00
Rob Herley
727cfbe442 better fallback for path and append aritfact name for mutli-download 2023-08-24 12:05:05 -04:00
Rob Herley
24b1443a07 use new @actions/artifact version & update download logic 2023-08-24 11:57:52 -04:00
Brian Flad
e9ef242655 Add download-path output to action.yml (#194)
Reference: https://github.com/actions/download-artifact/issues/153
Reference: https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#outputs-for-docker-container-and-javascript-actions

Prevents false positives from tooling, such as `actionlint`, that depends on the metadata for static analysis.

Co-authored-by: Konrad Pabjan <konradpabjan@github.com>
2023-01-05 17:35:52 -05:00
dependabot[bot]
adf9559c4f Bump json5 from 1.0.1 to 1.0.2 (#198)
Bumps [json5](https://github.com/json5/json5) from 1.0.1 to 1.0.2.
- [Release notes](https://github.com/json5/json5/releases)
- [Changelog](https://github.com/json5/json5/blob/main/CHANGELOG.md)
- [Commits](https://github.com/json5/json5/compare/v1.0.1...v1.0.2)

---
updated-dependencies:
- dependency-name: json5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-05 17:24:04 -05:00
Konrad Pabjan
9bc31d5ccc Update to latest actions/artifact NPM package (#195)
* Use latest actions/artifact NPM package + misc updates

* Use node 18 + caching in CI

* Run npm release

* Use node 16 for CI + devcontainer
2023-01-04 17:30:33 -05:00
Konrad Pabjan
d2278a10ef Update release-new-action-version.yml (#196) 2023-01-04 17:25:27 -05:00
Konrad Pabjan
c1a6d8f06a Update codeql-analysis.yml (#197) 2023-01-04 17:21:01 -05:00
Francesco Renzi
9782bd6a98 Update @actions/core to 1.10.0 (#178)
* Update @actions/core to 1.10.0

* Update licenses

* solve npm conflicts

* update licenses
2022-10-20 19:26:49 -04:00
Yang Cao
076f0f7dd0 Merge pull request #156 from actions/dependabot/npm_and_yarn/ansi-regex-4.1.1
Bump ansi-regex from 4.1.0 to 4.1.1
2022-04-25 10:12:25 -04:00
dependabot[bot]
7151be3221 Bump ansi-regex from 4.1.0 to 4.1.1
Bumps [ansi-regex](https://github.com/chalk/ansi-regex) from 4.1.0 to 4.1.1.
- [Release notes](https://github.com/chalk/ansi-regex/releases)
- [Commits](https://github.com/chalk/ansi-regex/compare/v4.1.0...v4.1.1)

---
updated-dependencies:
- dependency-name: ansi-regex
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-25 14:08:54 +00:00
Yang Cao
51cbdc41c1 Merge pull request #152 from actions/dependabot/npm_and_yarn/minimist-1.2.6
Bump minimist from 1.2.5 to 1.2.6
2022-04-25 10:08:26 -04:00
dependabot[bot]
e89a529079 Bump minimist from 1.2.5 to 1.2.6
Bumps [minimist](https://github.com/substack/minimist) from 1.2.5 to 1.2.6.
- [Release notes](https://github.com/substack/minimist/releases)
- [Commits](https://github.com/substack/minimist/compare/1.2.5...1.2.6)

---
updated-dependencies:
- dependency-name: minimist
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-26 14:50:08 +00:00
Jonathan Tamsut
fb598a63ae Merge pull request #136 from actions/jtamsut/update-lockfile-version
Update `lockfileVersion` in `package-lock.json`
2022-03-02 10:35:41 -08:00
Jonathan Tamsut
a4a09c5d7e regenerate index.js 2022-03-01 14:43:36 -08:00
Jonathan Tamsut
9acf51df79 regenerate package lock 2022-03-01 14:31:56 -08:00
Jonathan Tamsut
8821072325 upgrade artifact version 2022-03-01 14:30:51 -08:00
Jonathan Tamsut
b8bbd3b64f regenerate lockfile 2022-03-01 13:38:43 -08:00
Jonathan Tamsut
6ee3d963e5 revert artifact version 2022-03-01 13:37:07 -08:00
Jonathan Tamsut
d4793f4e27 update docs for v3 2022-03-01 13:27:20 -08:00
Jonathan Tamsut
2d338d2145 upgrade package to v3 2022-03-01 13:18:36 -08:00
Jonathan Tamsut
360d0830b5 update dependency on artifact lib 2022-03-01 13:14:55 -08:00
Jonathan Tamsut
d9b73cccac update lock file 2022-03-01 13:14:35 -08:00
Thomas Boop
a327a9c763 Update default runtime to node16 (#134)
Node 12 has an end of life on April 30, 2022.

This PR updates the default runtime to [node16](https://github.blog/changelog/2021-12-10-github-actions-github-hosted-runners-now-run-node-js-16-by-default/), rather then node12. 

This is supported on all Actions Runners v2.285.0 or later.
2022-02-07 21:18:27 +01:00
Konrad Pabjan
f023be2c48 Update @actions/artifact to version 0.6.0 (#123)
* Update @actions/artifact to version 0.6.0

* update artifact.dep.yml to use version 0.6.0
2021-12-07 11:44:54 -05:00
Konrad Pabjan
591af65465 Create release-new-action-version.yml (#122) 2021-12-02 11:14:52 -05:00
dependabot[bot]
f2e7c54ea3 Bump path-parse from 1.0.6 to 1.0.7 (#109)
Bumps [path-parse](https://github.com/jbgutierrez/path-parse) from 1.0.6 to 1.0.7.
- [Release notes](https://github.com/jbgutierrez/path-parse/releases)
- [Commits](https://github.com/jbgutierrez/path-parse/commits/v1.0.7)

---
updated-dependencies:
- dependency-name: path-parse
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-02 10:31:46 -05:00
Rob Herley
e15ea60964 Merge pull request #121 from actions/robherley/dupe-issue-template
rm dupe security vulnerability from issue template
2021-11-23 14:48:56 -05:00
Rob Herley
12f9853977 rm dupe security vulnerability from issue template 2021-11-23 14:46:39 -05:00
Rob Herley
b3f61af72c Merge pull request #120 from actions/robherley/update-issue-templates
Add issue templates
2021-11-22 16:49:17 -05:00
Rob Herley
ad79f6c16c add issue templates 2021-11-22 10:12:52 -05:00
Brian Cristante
b1985abdea Create check-dist.yml (#108)
* Add check-dist.yml

* Fix triggers in licensed.yml
2021-08-10 13:59:02 -04:00
Brian Cristante
3be87be14a Ingest v0.5.2 of @actions/artifact (#100)
* npm install --update @actions/artifact

* Update .licenses file

* npm run release
2021-06-16 16:19:05 -04:00
Brian Cristante
8bef1ad834 Merge pull request #97 from actions/dependabot/npm_and_yarn/glob-parent-5.1.2
Bump glob-parent from 5.1.1 to 5.1.2
2021-06-16 16:06:52 -04:00
Brian Cristante
2940e0d2ad Merge pull request #92 from actions/dependabot/npm_and_yarn/hosted-git-info-2.8.9
Bump hosted-git-info from 2.8.5 to 2.8.9
2021-06-16 16:06:23 -04:00
Brian Cristante
bd90b34638 Merge pull request #91 from actions/dependabot/npm_and_yarn/lodash-4.17.21
Bump lodash from 4.17.19 to 4.17.21
2021-06-16 16:06:06 -04:00
Brian Cristante
3b6d0aba35 Merge pull request #99 from actions/brcrista/dependabot-push
Don't trigger CodeQL on Dependabot push
2021-06-16 16:05:29 -04:00
Brian Cristante
46a6d6f216 Don't trigger CodeQL on Dependabot push 2021-06-16 16:01:04 -04:00
dependabot[bot]
246a0f4716 Bump glob-parent from 5.1.1 to 5.1.2
Bumps [glob-parent](https://github.com/gulpjs/glob-parent) from 5.1.1 to 5.1.2.
- [Release notes](https://github.com/gulpjs/glob-parent/releases)
- [Changelog](https://github.com/gulpjs/glob-parent/blob/main/CHANGELOG.md)
- [Commits](https://github.com/gulpjs/glob-parent/compare/v5.1.1...v5.1.2)

---
updated-dependencies:
- dependency-name: glob-parent
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-11 13:14:19 +00:00
Robert Cannon
df388c92ce Clarified the v1 and v2 differences (#96)
The original text implies by supplying no inputs all files are placed in the root directory without added directories by focusing only on the `path` input. In practice, supplying no inputs results in the backwards compatible `v1` behavior of creating an extra parameter. This may be obvious in some scenarios and stated somewhat later in the document, but is less obvious when the "name" matches a filename for a single file artifact.
2021-05-21 21:20:10 +02:00
dependabot[bot]
87f717a35d Bump hosted-git-info from 2.8.5 to 2.8.9
Bumps [hosted-git-info](https://github.com/npm/hosted-git-info) from 2.8.5 to 2.8.9.
- [Release notes](https://github.com/npm/hosted-git-info/releases)
- [Changelog](https://github.com/npm/hosted-git-info/blob/v2.8.9/CHANGELOG.md)
- [Commits](https://github.com/npm/hosted-git-info/compare/v2.8.5...v2.8.9)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-11 17:16:23 +00:00
dependabot[bot]
ae445150c2 Bump lodash from 4.17.19 to 4.17.21
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.19 to 4.17.21.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.19...4.17.21)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-11 12:10:53 +00:00
Konrad Pabjan
158ca71f7c Bump @actions/artifact to version 0.5.1 (#85) 2021-04-06 16:50:27 -04:00
dependabot[bot]
65bdb44741 Bump y18n from 4.0.0 to 4.0.1 (#84)
Bumps [y18n](https://github.com/yargs/y18n) from 4.0.0 to 4.0.1.
- [Release notes](https://github.com/yargs/y18n/releases)
- [Changelog](https://github.com/yargs/y18n/blob/master/CHANGELOG.md)
- [Commits](https://github.com/yargs/y18n/commits)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-06 15:23:44 -04:00
Josh Gross
782e5ae9ea Merge pull request #81 from rneatherway/codeql-add-pull-request-trigger
Add on: pull_request trigger to CodeQL workflow
2021-01-14 18:42:16 -05:00
Robin Neatherway
a6ff13d56d Add on: pull_request trigger to CodeQL workflow
From February 2021, in order to provide feedback on pull requests, Code Scanning workflows must be configured with both `push` and `pull_request` triggers. This is because Code Scanning compares the results from a pull request against the results for the base branch to tell you only what has changed between the two.

Early in the beta period we supported displaying results on pull requests for workflows with only `push` triggers, but have discontinued support as this proved to be less robust.

See https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#scanning-pull-requests for more information on how best to configure your Code Scanning workflows.
2021-01-13 11:19:52 +00:00
Konrad Pabjan
4a7a711286 Add retries to all HTTP calls + fix dependabot alerts (#80)
* Update @actions/artifact package to version 0.5.0

* bump eslint-plugin-github to version 4.1.1

* Update artifact.dep.yml
2021-01-04 15:47:26 +01:00
27 changed files with 121729 additions and 6562 deletions

View File

@@ -0,0 +1,6 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/typescript-node
{
"name": "@actions/download-artifact",
"image": "mcr.microsoft.com/devcontainers/typescript-node:0-16"
}

63
.github/ISSUE_TEMPLATE/bug-report.yml vendored Normal file
View File

@@ -0,0 +1,63 @@
name: "🐛 Bug report"
description: Let us know about a bug!
labels: ['bug']
title: '[bug]'
body:
- type: textarea
id: problem
attributes:
label: What happened?
description: |
Please provide a clear and concise description of what the bug is. If applicable, add screenshots to help explain your problem.
validations:
required: true
- type: textarea
id: expected
attributes:
label: What did you expect to happen?
validations:
required: true
- type: textarea
id: repro
attributes:
label: How can we reproduce it?
description: |
Please be minimal and precise as possible. If your repo/run is public, please include a URL so it is easier for us to investigate.
validations:
required: true
- type: textarea
id: additional
attributes:
label: Anything else we need to know?
- type: input
id: version
attributes:
label: What version of the action are you using?
placeholder: vX.Y.Z
description: |
Please check the documentation first since different major versions can have different behaviors.
validations:
required: true
- type: dropdown
id: environment
attributes:
label: What are your runner environments?
multiple: true
options:
- self-hosted
- linux
- window
- macos
validations:
required: true
- type: input
id: ghes
attributes:
label: Are you on GitHub Enterprise Server? If so, what version?
placeholder: vX.Y

5
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: 🙋 Ask a question
url: https://github.community/c/code-to-cloud/52
about: Please ask and answer questions on GitHub Support Community.

View File

@@ -0,0 +1,28 @@
name: "📚 Documentation issues"
description: Make a suggestion to improve the documentation!
labels: ['documentation']
title: '[docs]'
body:
- type: markdown
attributes:
value: |
❗ This is only for documentation updates for files in this repo, ie: `README.md`.
If you want to suggest changes for the [GitHub Docs](https://docs.github.com/), please [open an issue there](https://github.com/github/docs/issues/new/choose).
- type: textarea
id: affected
attributes:
label: What files would you like to change?
description: |
Please provide permalinks to the specified files and line numbers.
validations:
required: true
- type: textarea
id: suggested
attributes:
label: What are your suggested changes?
description: |
Give as much detail as you can to help us understand the changes you want to see.
validations:
required: true

View File

@@ -0,0 +1,20 @@
name: "🎁 Feature request"
description: Suggest a new feature/enhancement!
labels: ['enhancement']
title: '[feat req]'
body:
- type: textarea
id: feature
attributes:
label: What would you like to be added?
description: |
Please check existing issues to avoid making duplicates. Any duplicate issue will be closed immediately.
validations:
required: true
- type: textarea
id: reasoning
attributes:
label: Why is this needed?
validations:
required: true

53
.github/workflows/check-dist.yml vendored Normal file
View File

@@ -0,0 +1,53 @@
# `dist/index.js` is a special file in Actions.
# When you reference an action with `uses:` in a workflow,
# `index.js` is the code that will run.
# For our project, we generate this file through a build process
# from other source files.
# We need to make sure the checked-in `index.js` actually matches what we expect it to be.
name: Check dist/
on:
push:
branches:
- main
paths-ignore:
- '**.md'
pull_request:
paths-ignore:
- '**.md'
workflow_dispatch:
jobs:
check-dist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Node 16
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Rebuild the dist/ directory
run: npm run build
- name: Compare the expected and actual dist/ directories
run: |
if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then
echo "Detected uncommitted changes after build. See status below:"
git diff
exit 1
fi
id: diff
# If index.js was different than expected, upload the expected version as an artifact
- uses: actions/upload-artifact@v3
if: ${{ failure() && steps.diff.conclusion == 'failure' }}
with:
name: dist
path: dist/

View File

@@ -2,6 +2,8 @@ name: "Code scanning - action"
on:
push:
branches-ignore: "dependabot/**"
pull_request:
paths-ignore:
- '**.md'
schedule:
@@ -18,11 +20,11 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v2
# Override language selection by uncommenting this and choosing your languages
# with:
# languages: go, javascript, csharp, python, cpp, java
@@ -30,7 +32,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1
uses: github/codeql-action/autobuild@v2
# Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
@@ -44,4 +46,4 @@ jobs:
# make release
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v2

View File

@@ -1,15 +1,19 @@
name: Licensed
on:
push: {branches: main}
pull_request: {branches: main}
push:
branches:
- main
pull_request:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
name: Check licenses
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- run: npm ci
- name: Install licensed
run: |
@@ -17,4 +21,4 @@ jobs:
curl -Lfs -o licensed.tar.gz https://github.com/github/licensed/releases/download/2.12.2/licensed-2.12.2-linux-x64.tar.gz
sudo tar -xzf licensed.tar.gz
sudo mv licensed /usr/local/bin/licensed
- run: licensed status
- run: licensed status

View File

@@ -0,0 +1,27 @@
name: Release new action version
on:
release:
types: [released]
workflow_dispatch:
inputs:
TAG_NAME:
description: 'Tag name that the major tag will point to'
required: true
env:
TAG_NAME: ${{ github.event.inputs.TAG_NAME || github.event.release.tag_name }}
permissions:
contents: write
jobs:
update_tag:
name: Update the major tag to include the ${{ github.event.inputs.TAG_NAME || github.event.release.tag_name }} changes
environment:
name: releaseNewActionVersion
runs-on: ubuntu-latest
steps:
- name: Update the ${{ env.TAG_NAME }} tag
uses: actions/publish-action@v0.2.1
with:
source-tag: ${{ env.TAG_NAME }}
slack-webhook: ${{ secrets.SLACK_WEBHOOK }}

View File

@@ -21,12 +21,14 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Set Node.js 12.x
uses: actions/setup-node@v1
# using node 16 since that is what the latest version of the runner ships with
- name: Setup Node 16
uses: actions/setup-node@v3
with:
node-version: 12.x
node-version: 16.x
cache: 'npm'
- name: npm install
run: npm install

View File

@@ -1,6 +1,6 @@
---
name: "@actions/artifact"
version: 0.4.2
version: 1.1.1
type: npm
summary: Actions artifact lib
homepage: https://github.com/actions/toolkit/tree/main/packages/artifact

View File

@@ -1,30 +1,20 @@
---
name: "@actions/core"
version: 1.2.6
version: 1.10.0
type: npm
summary: Actions core lib
homepage: https://github.com/actions/toolkit/tree/master/packages/core
homepage: https://github.com/actions/toolkit/tree/main/packages/core
license: mit
licenses:
- sources: Auto-generated MIT license text
text: |
MIT License
- sources: LICENSE.md
text: |-
The MIT License (MIT)
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:
Copyright 2019 GitHub
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
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 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.
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: []

View File

@@ -1,6 +1,6 @@
---
name: "@actions/http-client"
version: 1.0.9
version: 1.0.11
type: npm
summary: Actions Http Client
homepage: https://github.com/actions/http-client#readme

View File

@@ -0,0 +1,32 @@
---
name: "@actions/http-client"
version: 2.0.1
type: npm
summary: Actions Http Client
homepage: https://github.com/actions/toolkit/tree/main/packages/http-client
license: mit
licenses:
- sources: LICENSE
text: |
Actions Http Client for Node.js
Copyright (c) GitHub, Inc.
All rights reserved.
MIT License
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: []

View File

@@ -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: []

View File

@@ -1,9 +1,9 @@
---
name: minimatch
version: 3.0.4
version: 3.1.2
type: npm
summary: a glob matcher in javascript
homepage: https://github.com/isaacs/minimatch#readme
homepage:
license: isc
licenses:
- sources: LICENSE

View File

@@ -1,9 +1,9 @@
---
name: rimraf
version: 2.6.3
version: 3.0.2
type: npm
summary: A deep deletion module for node (like `rm -rf`)
homepage: https://github.com/isaacs/rimraf#readme
homepage:
license: isc
licenses:
- sources: LICENSE

View File

@@ -1,9 +1,9 @@
---
name: tmp-promise
version: 2.1.1
version: 3.0.3
type: npm
summary: The tmp package with promises support and disposers.
homepage: https://github.com/benjamingr/tmp-promise#readme
homepage:
license: mit
licenses:
- sources: Auto-generated MIT license text

View File

@@ -1,6 +1,6 @@
---
name: tmp
version: 0.1.0
version: 0.2.1
type: npm
summary: Temporary file and directory creator
homepage: http://github.com/raszi/node-tmp

20
.licenses/npm/uuid.dep.yml generated Normal file
View 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: []

View File

@@ -1,4 +1,4 @@
# Download-Artifact v2
# Download-Artifact v3
This downloads artifacts from your build
@@ -10,7 +10,7 @@ See also [upload-artifact](https://github.com/actions/upload-artifact).
- Output parameter for the download path
- Port entire action to typescript from a runner plugin so it is easier to collaborate and accept contributions
Refer [here](https://github.com/actions/download-artifact/tree/v1) for the previous version
Refer [here](https://github.com/actions/download-artifact/tree/v2) for the previous version
# Usage
@@ -21,9 +21,9 @@ See [action.yml](action.yml)
Basic (download to the current working directory):
```yaml
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v3
with:
name: my-artifact
@@ -34,9 +34,9 @@ steps:
Download to a specific directory:
```yaml
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v3
with:
name: my-artifact
path: path/to/artifact
@@ -48,13 +48,13 @@ steps:
Basic tilde expansion is supported for the `path` input:
```yaml
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v3
with:
name: my-artifact
path: ~/download/path
```
## Compatibility between `v1` and `v2`
## Compatibility between `v1` and `v2`/`v3`
When using `download-artifact@v1`, a directory denoted by the name of the artifact would be created if the `path` input was not provided. All of the contents would be downloaded to this directory.
```
@@ -63,13 +63,13 @@ When using `download-artifact@v1`, a directory denoted by the name of the artifa
... contents of my-artifact
```
With `v2`, there is no longer an extra directory that is created if the `path` input is not provided. All the contents are downloaded to the current working directory.
With `v2` and `v3`, when an artifact is specified by the `name` input, there is no longer an extra directory that is created if the `path` input is not provided. All the contents are downloaded to the current working directory.
```
current/working/directory/
... contents of my-artifact
```
To maintain the same behavior for `v2`, you can set the `path` to the name of the artifact so an extra directory gets created.
To maintain the same behavior for `v2` and `v3`, you can set the `path` to the name of the artifact so an extra directory gets created.
```
- uses: actions/download-artifact@v2
with:
@@ -93,9 +93,9 @@ Example, if there are two artifacts `Artifact-A` and `Artifact-B`, and the direc
Download all artifacts to a specific directory
```yaml
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v3
with:
path: path/to/artifacts
@@ -107,9 +107,9 @@ steps:
Download all artifacts to the current working directory
```yaml
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v3
- name: Display structure of downloaded files
run: ls -R
@@ -121,9 +121,9 @@ The `download-path` step output contains information regarding where the artifac
```yaml
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v3
id: download
with:
name: 'my-artifact'

View File

@@ -1,13 +1,31 @@
name: 'Download a Build Artifact'
description: 'Download a build artifact that was previously uploaded in the workflow by the upload-artifact action'
author: 'GitHub'
inputs:
inputs:
name:
description: 'Artifact name'
required: false
path:
description: 'Destination path'
required: false
github-token:
description: 'The GitHub token used to authenticate with the GitHub API.
This is required when downloading artifacts from a different repository or from a different workflow run.
If this is not specified, the action will attempt to download artifacts from the current repository and the current workflow run.'
required: false
repository:
description: 'The repository owner and the repository name joined together by "/".
If github-token is specified, this is the repository that artifacts will be downloaded from.'
required: false
default: ${{ github.repository }}
run-id:
description: 'The id of the workflow run where the desired download artifact was uploaded from.
If github-token is specified, this is the run that artifacts will be downloaded from.'
required: false
default: ${{ github.run_id }}
outputs:
download-path:
description: 'Path of artifact download'
runs:
using: 'node12'
main: 'dist/index.js'
using: 'node20'
main: 'dist/index.js'

122625
dist/index.js vendored

File diff suppressed because one or more lines are too long

5083
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{
"name": "download-artifact",
"version": "2.0.0",
"version": "3.0.0",
"description": "Download a build artifact that was previously uploaded in the workflow by the upload-artifact action",
"main": "dist/index.js",
"scripts": {
@@ -28,16 +28,17 @@
},
"homepage": "https://github.com/actions/download-artifact#readme",
"dependencies": {
"@actions/artifact": "^0.4.2",
"@actions/core": "^1.2.6"
"@actions/artifact": "^2.0.0",
"@actions/core": "^1.10.0",
"@actions/github": "^5.1.1"
},
"devDependencies": {
"@types/node": "^12.12.6",
"@typescript-eslint/parser": "^2.30.0",
"@zeit/ncc": "^0.22.1",
"@typescript-eslint/eslint-plugin": "^5.40.1",
"@vercel/ncc": "^0.33.4",
"concurrently": "^5.2.0",
"eslint": "^7.4.0",
"eslint-plugin-github": "^3.4.1",
"eslint-plugin-github": "^4.1.1",
"prettier": "^2.0.5",
"typescript": "^3.8.3"
}

View File

@@ -1,7 +1,11 @@
export enum Inputs {
Name = 'name',
Path = 'path'
Path = 'path',
GitHubToken = 'github-token',
Repository = 'repository',
RunID = 'run-id'
}
export enum Outputs {
DownloadPath = 'download-path'
}

View File

@@ -1,61 +1,103 @@
import * as os from 'os'
import * as path from 'path'
import * as core from '@actions/core'
import * as artifact from '@actions/artifact'
import * as os from 'os'
import {resolve} from 'path'
import {Inputs, Outputs} from './constants'
const PARALLEL_DOWNLOADS = 5
export const chunk = <T>(arr: T[], n: number): T[][] =>
arr.reduce((acc, cur, i) => {
const index = Math.floor(i / n)
acc[index] = [...(acc[index] || []), cur]
return acc
}, [] as T[][])
async function run(): Promise<void> {
try {
const name = core.getInput(Inputs.Name, {required: false})
const path = core.getInput(Inputs.Path, {required: false})
let resolvedPath
// resolve tilde expansions, path.replace only replaces the first occurrence of a pattern
if (path.startsWith(`~`)) {
resolvedPath = resolve(path.replace('~', os.homedir()))
} else {
resolvedPath = resolve(path)
}
core.debug(`Resolved path is ${resolvedPath}`)
const artifactClient = artifact.create()
if (!name) {
// download all artifacts
core.info('No artifact name specified, downloading all artifacts')
core.info(
'Creating an extra directory for each artifact that is being downloaded'
)
const downloadResponse = await artifactClient.downloadAllArtifacts(
resolvedPath
)
core.info(`There were ${downloadResponse.length} artifacts downloaded`)
for (const artifact of downloadResponse) {
core.info(
`Artifact ${artifact.artifactName} was downloaded to ${artifact.downloadPath}`
)
}
} else {
// download a single artifact
core.info(`Starting download for ${name}`)
const downloadOptions = {
createArtifactFolder: false
}
const downloadResponse = await artifactClient.downloadArtifact(
name,
resolvedPath,
downloadOptions
)
core.info(
`Artifact ${downloadResponse.artifactName} was downloaded to ${downloadResponse.downloadPath}`
)
}
// output the directory that the artifact(s) was/were downloaded to
// if no path is provided, an empty string resolves to the current working directory
core.setOutput(Outputs.DownloadPath, resolvedPath)
core.info('Artifact download has finished successfully')
} catch (err) {
core.setFailed(err.message)
const inputs = {
name: core.getInput(Inputs.Name, {required: false}),
path: core.getInput(Inputs.Path, {required: false}),
token: core.getInput(Inputs.GitHubToken, {required: false}),
repository: core.getInput(Inputs.Repository, {required: false}),
runID: parseInt(core.getInput(Inputs.RunID, {required: false}))
}
if (!inputs.path) {
inputs.path = process.env['GITHUB_WORKSPACE'] || process.cwd()
}
if (inputs.path.startsWith(`~`)) {
inputs.path = inputs.path.replace('~', os.homedir())
}
const resolvedPath = path.resolve(inputs.path)
core.debug(`Resolved path is ${resolvedPath}`)
const options: artifact.FindOptions = {}
if (inputs.token) {
const [repositoryOwner, repositoryName] = inputs.repository.split('/')
if (!repositoryOwner || !repositoryName) {
throw new Error(
`Invalid repository: '${inputs.repository}'. Must be in format owner/repo`
)
}
options.findBy = {
token: inputs.token,
workflowRunId: inputs.runID,
repositoryName,
repositoryOwner
}
}
const artifactClient = artifact.create()
let artifacts: artifact.Artifact[] = []
if (inputs.name) {
const {artifact: targetArtifact} = await artifactClient.getArtifact(
inputs.name,
options
)
if (!targetArtifact) {
throw new Error(`Artifact '${inputs.name}' not found`)
}
core.debug('Found named artifact:')
core.debug(JSON.stringify(targetArtifact, null, 2))
artifacts = [targetArtifact]
} else {
const listArtifactResponse = await artifactClient.listArtifacts(options)
if (listArtifactResponse.artifacts.length === 0) {
throw new Error(
`No artifacts found for run '${inputs.runID}' in '${inputs.repository}'`
)
}
core.debug(`Found ${listArtifactResponse.artifacts.length} artifacts:`)
core.debug(JSON.stringify(listArtifactResponse, null, 2))
artifacts = listArtifactResponse.artifacts
}
const downloadPromises = artifacts.map(artifact =>
artifactClient.downloadArtifact(artifact.id, {
...options,
path: path.join(resolvedPath, artifact.name)
})
)
const chunkedPromises = chunk(downloadPromises, PARALLEL_DOWNLOADS)
for (const chunk of chunkedPromises) {
await Promise.all(chunk)
}
core.info(`Total of ${artifacts.length} artifact(s) downloaded`)
core.setOutput(Outputs.DownloadPath, resolvedPath)
core.info('Download artifact has finished successfully')
}
run()
run().catch(err =>
core.setFailed(`Unable to download artifact(s): ${err.message}`)
)