Merge pull request #7 from crazy-max/context-input

context input
This commit is contained in:
CrazyMax authored and GitHub committed 2023-03-10 01:35:42 +00:00
commit c3a68cbeca
8 files changed
+50 -12

No files matched your search

+24
View File
@@ -50,3 +50,27 @@ jobs:
with:
version: v23.0.0-rc.4
channel: test
context:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Set up Docker
uses: ./
with:
version: v23.0.0
context: foo
-
name: Check context
run: |
docker context inspect foo
+7 -6
View File
@@ -6,8 +6,8 @@
## About
GitHub Action to set up [Docker CE](https://docs.docker.com/engine/). Works on
Linux, macOS and Windows.
GitHub Action to set up (download and install) [Docker CE](https://docs.docker.com/engine/).
Works on Linux, macOS and Windows.
![Screenshot](.github/setup-docker-action.png)
@@ -41,10 +41,11 @@ jobs:
Following inputs can be used as `step.with` keys
| Name | Type | Default | Description |
|-----------|--------|----------|---------------------------------------------------------------------------------------------------|
| `version` | String | `latest` | Docker CE version (e.g., `v23.0.1`). |
| `channel` | String | `stable` | Docker CE [channel](https://download.docker.com/linux/static/) (e.g, `stable`, `edge` or `test`). |
| Name | Type | Default | Description |
|-----------|--------|-----------------------|---------------------------------------------------------------------------------------------------|
| `version` | String | `latest` | Docker CE version (e.g., `v23.0.1`). |
| `channel` | String | `stable` | Docker CE [channel](https://download.docker.com/linux/static/) (e.g, `stable`, `edge` or `test`). |
| `context` | String | `setup-docker-action` | Docker context name. |
## Contributing
+3
View File
@@ -22,6 +22,7 @@ describe('getInputs', () => {
{
version: 'v23.0.1',
channel: '',
context: '',
} as context.Inputs
],
[
@@ -29,10 +30,12 @@ describe('getInputs', () => {
new Map<string, string>([
['version', 'v23.0.0-rc.4'],
['channel', 'test'],
['context', 'foo'],
]),
{
version: 'v23.0.0-rc.4',
channel: 'test',
context: 'foo',
} as context.Inputs
]
])(
+4 -1
View File
@@ -1,6 +1,6 @@
# https://help.github.com/en/articles/metadata-syntax-for-github-actions
name: 'Docker Setup Docker'
description: 'Set up Docker'
description: 'Set up Docker for use in GitHub Actions by downloading and installing a version of Docker CE'
author: 'docker'
branding:
icon: 'anchor'
@@ -13,6 +13,9 @@ inputs:
channel:
description: 'Docker CE channel. (e.g, stable, edge or test)'
required: false
context:
description: 'Docker context name. (default setup-docker-action)'
required: false
runs:
using: 'node16'
Generated Vendored
+1 -1
View File
@@ -12,5 +12,5 @@ require('./sourcemap-register.js');(()=>{var __webpack_modules__={7351:function(
*
* MIT Licensed
*/
const s=i(7147);const p=i(2037);const d=i(1017);const l=i(6113);const u={fs:s.constants,os:p.constants};const c=i(4959);const m="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",h=/XXXXXX/,v=3,g=(u.O_CREAT||u.fs.O_CREAT)|(u.O_EXCL||u.fs.O_EXCL)|(u.O_RDWR||u.fs.O_RDWR),_=p.platform()==="win32",w=u.EBADF||u.os.errno.EBADF,b=u.ENOENT||u.os.errno.ENOENT,y=448,E=384,S="exit",T=[],O=s.rmdirSync.bind(s),k=c.sync;let P=false;function tmpName(r,a){const i=_parseArguments(r,a),p=i[0],d=i[1];try{_assertAndSanitizeOptions(p)}catch(r){return d(r)}let l=p.tries;(function _getUniqueName(){try{const r=_generateTmpName(p);s.stat(r,(function(a){if(!a){if(l-- >0)return _getUniqueName();return d(new Error("Could not get a unique tmp filename, max tries reached "+r))}d(null,r)}))}catch(r){d(r)}})()}function tmpNameSync(r){const a=_parseArguments(r),i=a[0];_assertAndSanitizeOptions(i);let p=i.tries;do{const r=_generateTmpName(i);try{s.statSync(r)}catch(a){return r}}while(p-- >0);throw new Error("Could not get a unique tmp filename, max tries reached")}function file(r,a){const i=_parseArguments(r,a),p=i[0],d=i[1];tmpName(p,(function _tmpNameCreated(r,a){if(r)return d(r);s.open(a,g,p.mode||E,(function _fileCreated(r,i){if(r)return d(r);if(p.discardDescriptor){return s.close(i,(function _discardCallback(r){return d(r,a,undefined,_prepareTmpFileRemoveCallback(a,-1,p,false))}))}else{const r=p.discardDescriptor||p.detachDescriptor;d(null,a,i,_prepareTmpFileRemoveCallback(a,r?-1:i,p,false))}}))}))}function fileSync(r){const a=_parseArguments(r),i=a[0];const p=i.discardDescriptor||i.detachDescriptor;const d=tmpNameSync(i);var l=s.openSync(d,g,i.mode||E);if(i.discardDescriptor){s.closeSync(l);l=undefined}return{name:d,fd:l,removeCallback:_prepareTmpFileRemoveCallback(d,p?-1:l,i,true)}}function dir(r,a){const i=_parseArguments(r,a),p=i[0],d=i[1];tmpName(p,(function _tmpNameCreated(r,a){if(r)return d(r);s.mkdir(a,p.mode||y,(function _dirCreated(r){if(r)return d(r);d(null,a,_prepareTmpDirRemoveCallback(a,p,false))}))}))}function dirSync(r){const a=_parseArguments(r),i=a[0];const p=tmpNameSync(i);s.mkdirSync(p,i.mode||y);return{name:p,removeCallback:_prepareTmpDirRemoveCallback(p,i,true)}}function _removeFileAsync(r,a){const _handler=function(r){if(r&&!_isENOENT(r)){return a(r)}a()};if(0<=r[0])s.close(r[0],(function(){s.unlink(r[1],_handler)}));else s.unlink(r[1],_handler)}function _removeFileSync(r){let a=null;try{if(0<=r[0])s.closeSync(r[0])}catch(r){if(!_isEBADF(r)&&!_isENOENT(r))throw r}finally{try{s.unlinkSync(r[1])}catch(r){if(!_isENOENT(r))a=r}}if(a!==null){throw a}}function _prepareTmpFileRemoveCallback(r,a,i,s){const p=_prepareRemoveCallback(_removeFileSync,[a,r],s);const d=_prepareRemoveCallback(_removeFileAsync,[a,r],s,p);if(!i.keep)T.unshift(p);return s?p:d}function _prepareTmpDirRemoveCallback(r,a,i){const p=a.unsafeCleanup?c:s.rmdir.bind(s);const d=a.unsafeCleanup?k:O;const l=_prepareRemoveCallback(d,r,i);const u=_prepareRemoveCallback(p,r,i,l);if(!a.keep)T.unshift(l);return i?l:u}function _prepareRemoveCallback(r,a,i,s){let p=false;return function _cleanupCallback(d){if(!p){const l=s||_cleanupCallback;const u=T.indexOf(l);if(u>=0)T.splice(u,1);p=true;if(i||r===O||r===k){return r(a)}else{return r(a,d||function(){})}}}}function _garbageCollector(){if(!P)return;while(T.length){try{T[0]()}catch(r){}}}function _randomChars(r){let a=[],i=null;try{i=l.randomBytes(r)}catch(a){i=l.pseudoRandomBytes(r)}for(var s=0;s<r;s++){a.push(m[i[s]%m.length])}return a.join("")}function _isBlank(r){return r===null||_isUndefined(r)||!r.trim()}function _isUndefined(r){return typeof r==="undefined"}function _parseArguments(r,a){if(typeof r==="function"){return[{},r]}if(_isUndefined(r)){return[{},a]}const i={};for(const a of Object.getOwnPropertyNames(r)){i[a]=r[a]}return[i,a]}function _generateTmpName(r){const a=r.tmpdir;if(!_isUndefined(r.name))return d.join(a,r.dir,r.name);if(!_isUndefined(r.template))return d.join(a,r.dir,r.template).replace(h,_randomChars(6));const i=[r.prefix?r.prefix:"tmp","-",process.pid,"-",_randomChars(12),r.postfix?"-"+r.postfix:""].join("");return d.join(a,r.dir,i)}function _assertAndSanitizeOptions(r){r.tmpdir=_getTmpDir(r);const a=r.tmpdir;if(!_isUndefined(r.name))_assertIsRelative(r.name,"name",a);if(!_isUndefined(r.dir))_assertIsRelative(r.dir,"dir",a);if(!_isUndefined(r.template)){_assertIsRelative(r.template,"template",a);if(!r.template.match(h))throw new Error(`Invalid template, found "${r.template}".`)}if(!_isUndefined(r.tries)&&isNaN(r.tries)||r.tries<0)throw new Error(`Invalid tries, found "${r.tries}".`);r.tries=_isUndefined(r.name)?r.tries||v:1;r.keep=!!r.keep;r.detachDescriptor=!!r.detachDescriptor;r.discardDescriptor=!!r.discardDescriptor;r.unsafeCleanup=!!r.unsafeCleanup;r.dir=_isUndefined(r.dir)?"":d.relative(a,_resolvePath(r.dir,a));r.template=_isUndefined(r.template)?undefined:d.relative(a,_resolvePath(r.template,a));r.template=_isBlank(r.template)?undefined:d.relative(r.dir,r.template);r.naLine truncated
const s=i(7147);const p=i(2037);const d=i(1017);const l=i(6113);const u={fs:s.constants,os:p.constants};const c=i(4959);const m="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",h=/XXXXXX/,v=3,g=(u.O_CREAT||u.fs.O_CREAT)|(u.O_EXCL||u.fs.O_EXCL)|(u.O_RDWR||u.fs.O_RDWR),_=p.platform()==="win32",w=u.EBADF||u.os.errno.EBADF,b=u.ENOENT||u.os.errno.ENOENT,y=448,E=384,S="exit",T=[],O=s.rmdirSync.bind(s),k=c.sync;let P=false;function tmpName(r,a){const i=_parseArguments(r,a),p=i[0],d=i[1];try{_assertAndSanitizeOptions(p)}catch(r){return d(r)}let l=p.tries;(function _getUniqueName(){try{const r=_generateTmpName(p);s.stat(r,(function(a){if(!a){if(l-- >0)return _getUniqueName();return d(new Error("Could not get a unique tmp filename, max tries reached "+r))}d(null,r)}))}catch(r){d(r)}})()}function tmpNameSync(r){const a=_parseArguments(r),i=a[0];_assertAndSanitizeOptions(i);let p=i.tries;do{const r=_generateTmpName(i);try{s.statSync(r)}catch(a){return r}}while(p-- >0);throw new Error("Could not get a unique tmp filename, max tries reached")}function file(r,a){const i=_parseArguments(r,a),p=i[0],d=i[1];tmpName(p,(function _tmpNameCreated(r,a){if(r)return d(r);s.open(a,g,p.mode||E,(function _fileCreated(r,i){if(r)return d(r);if(p.discardDescriptor){return s.close(i,(function _discardCallback(r){return d(r,a,undefined,_prepareTmpFileRemoveCallback(a,-1,p,false))}))}else{const r=p.discardDescriptor||p.detachDescriptor;d(null,a,i,_prepareTmpFileRemoveCallback(a,r?-1:i,p,false))}}))}))}function fileSync(r){const a=_parseArguments(r),i=a[0];const p=i.discardDescriptor||i.detachDescriptor;const d=tmpNameSync(i);var l=s.openSync(d,g,i.mode||E);if(i.discardDescriptor){s.closeSync(l);l=undefined}return{name:d,fd:l,removeCallback:_prepareTmpFileRemoveCallback(d,p?-1:l,i,true)}}function dir(r,a){const i=_parseArguments(r,a),p=i[0],d=i[1];tmpName(p,(function _tmpNameCreated(r,a){if(r)return d(r);s.mkdir(a,p.mode||y,(function _dirCreated(r){if(r)return d(r);d(null,a,_prepareTmpDirRemoveCallback(a,p,false))}))}))}function dirSync(r){const a=_parseArguments(r),i=a[0];const p=tmpNameSync(i);s.mkdirSync(p,i.mode||y);return{name:p,removeCallback:_prepareTmpDirRemoveCallback(p,i,true)}}function _removeFileAsync(r,a){const _handler=function(r){if(r&&!_isENOENT(r)){return a(r)}a()};if(0<=r[0])s.close(r[0],(function(){s.unlink(r[1],_handler)}));else s.unlink(r[1],_handler)}function _removeFileSync(r){let a=null;try{if(0<=r[0])s.closeSync(r[0])}catch(r){if(!_isEBADF(r)&&!_isENOENT(r))throw r}finally{try{s.unlinkSync(r[1])}catch(r){if(!_isENOENT(r))a=r}}if(a!==null){throw a}}function _prepareTmpFileRemoveCallback(r,a,i,s){const p=_prepareRemoveCallback(_removeFileSync,[a,r],s);const d=_prepareRemoveCallback(_removeFileAsync,[a,r],s,p);if(!i.keep)T.unshift(p);return s?p:d}function _prepareTmpDirRemoveCallback(r,a,i){const p=a.unsafeCleanup?c:s.rmdir.bind(s);const d=a.unsafeCleanup?k:O;const l=_prepareRemoveCallback(d,r,i);const u=_prepareRemoveCallback(p,r,i,l);if(!a.keep)T.unshift(l);return i?l:u}function _prepareRemoveCallback(r,a,i,s){let p=false;return function _cleanupCallback(d){if(!p){const l=s||_cleanupCallback;const u=T.indexOf(l);if(u>=0)T.splice(u,1);p=true;if(i||r===O||r===k){return r(a)}else{return r(a,d||function(){})}}}}function _garbageCollector(){if(!P)return;while(T.length){try{T[0]()}catch(r){}}}function _randomChars(r){let a=[],i=null;try{i=l.randomBytes(r)}catch(a){i=l.pseudoRandomBytes(r)}for(var s=0;s<r;s++){a.push(m[i[s]%m.length])}return a.join("")}function _isBlank(r){return r===null||_isUndefined(r)||!r.trim()}function _isUndefined(r){return typeof r==="undefined"}function _parseArguments(r,a){if(typeof r==="function"){return[{},r]}if(_isUndefined(r)){return[{},a]}const i={};for(const a of Object.getOwnPropertyNames(r)){i[a]=r[a]}return[i,a]}function _generateTmpName(r){const a=r.tmpdir;if(!_isUndefined(r.name))return d.join(a,r.dir,r.name);if(!_isUndefined(r.template))return d.join(a,r.dir,r.template).replace(h,_randomChars(6));const i=[r.prefix?r.prefix:"tmp","-",process.pid,"-",_randomChars(12),r.postfix?"-"+r.postfix:""].join("");return d.join(a,r.dir,i)}function _assertAndSanitizeOptions(r){r.tmpdir=_getTmpDir(r);const a=r.tmpdir;if(!_isUndefined(r.name))_assertIsRelative(r.name,"name",a);if(!_isUndefined(r.dir))_assertIsRelative(r.dir,"dir",a);if(!_isUndefined(r.template)){_assertIsRelative(r.template,"template",a);if(!r.template.match(h))throw new Error(`Invalid template, found "${r.template}".`)}if(!_isUndefined(r.tries)&&isNaN(r.tries)||r.tries<0)throw new Error(`Invalid tries, found "${r.tries}".`);r.tries=_isUndefined(r.name)?r.tries||v:1;r.keep=!!r.keep;r.detachDescriptor=!!r.detachDescriptor;r.discardDescriptor=!!r.discardDescriptor;r.unsafeCleanup=!!r.unsafeCleanup;r.dir=_isUndefined(r.dir)?"":d.relative(a,_resolvePath(r.dir,a));r.template=_isUndefined(r.template)?undefined:d.relative(a,_resolvePath(r.template,a));r.template=_isBlank(r.template)?undefined:d.relative(r.dir,r.template);r.naLine truncated
//# sourceMappingURL=index.js.map
Generated Vendored
+1 -1
View File
@@ -1 +1 @@
{"version":3,"sources":["../webpack:/docker-setup-docker/node_modules/@actions/core/lib/command.js","../webpack:/docker-setup-docker/node_modules/@actions/core/lib/core.js","../webpack:/docker-setup-docker/node_modules/@actions/core/lib/file-command.js","../webpack:/docker-setup-docker/node_modules/@actions/core/lib/oidc-utils.js","../webpack:/docker-setup-docker/node_modules/@actions/core/lib/path-utils.js","../webpack:/docker-setup-docker/node_modules/@actions/core/lib/summary.js","../webpack:/docker-setup-docker/node_modules/@actions/core/lib/utils.js","../webpack:/docker-setup-docker/node_modules/@actions/core/node_modules/uuid/dist/index.js","../webpack:/docker-setup-docker/node_modules/@actions/core/node_modules/uuid/dist/md5.js","../webpack:/docker-setup-docker/node_modules/@actions/core/node_modules/uuid/dist/nil.js","../webpack:/docker-setup-docker/node_modules/@actions/core/node_modules/uuid/dist/parse.js","../webpack:/docker-setup-docker/node_modules/@actions/core/node_modules/uuid/dist/regex.js","../webpack:/docker-setup-docker/node_modules/@actions/core/node_modules/uuid/dist/rng.js","../webpack:/docker-setup-docker/node_modules/@actions/core/node_modules/uuid/dist/sha1.js","../webpack:/docker-setup-docker/node_modules/@actions/core/node_modules/uuid/dist/stringify.js","../webpack:/docker-setup-docker/node_modules/@actions/core/node_modules/uuid/dist/v1.js","../webpack:/docker-setup-docker/node_modules/@actions/core/node_modules/uuid/dist/v3.js","../webpack:/docker-setup-docker/node_modules/@actions/core/node_modules/uuid/dist/v35.js","../webpack:/docker-setup-docker/node_modules/@actions/core/node_modules/uuid/dist/v4.js","../webpack:/docker-setup-docker/node_modules/@actions/core/node_modules/uuid/dist/v5.js","../webpack:/docker-setup-docker/node_modules/@actions/core/node_modules/uuid/dist/validate.js","../webpack:/docker-setup-docker/node_modules/@actions/core/node_modules/uuid/dist/version.js","../webpack:/docker-setup-docker/node_modules/@actions/exec/lib/exec.js","../webpack:/docker-setup-docker/node_modules/@actions/exec/lib/toolrunner.js","../webpack:/docker-setup-docker/node_modules/@actions/github/lib/context.js","../webpack:/docker-setup-docker/node_modules/@actions/github/lib/github.js","../webpack:/docker-setup-docker/node_modules/@actions/github/lib/internal/utils.js","../webpack:/docker-setup-docker/node_modules/@actions/github/lib/utils.js","../webpack:/docker-setup-docker/node_modules/@actions/http-client/lib/auth.js","../webpack:/docker-setup-docker/node_modules/@actions/http-client/lib/index.js","../webpack:/docker-setup-docker/node_modules/@actions/http-client/lib/proxy.js","../webpack:/docker-setup-docker/node_modules/@actions/io/lib/io-util.js","../webpack:/docker-setup-docker/node_modules/@actions/io/lib/io.js","../webpack:/docker-setup-docker/node_modules/@actions/tool-cache/lib/manifest.js","../webpack:/docker-setup-docker/node_modules/@actions/tool-cache/lib/retry-helper.js","../webpack:/docker-setup-docker/node_modules/@actions/tool-cache/lib/tool-cache.js","../webpack:/docker-setup-docker/node_modules/@actions/tool-cache/node_modules/semver/semver.js","../webpack:/docker-setup-docker/node_modules/@actions/tool-cache/node_modules/uuid/lib/bytesToUuid.js","../webpack:/docker-setup-docker/node_modules/@actions/tool-cache/node_modules/uuid/lib/rng.js","../webpack:/docker-setup-docker/node_modules/@actions/tool-cache/node_modules/uuid/v4.js","../webpack:/docker-setup-docker/node_modules/@docker/actions-toolkit/lib/context.js","../webpack:/docker-setup-docker/node_modules/@docker/actions-toolkit/lib/docker/assets.js","../webpack:/docker-setup-docker/node_modules/@docker/actions-toolkit/lib/docker/docker.js","../webpack:/docker-setup-docker/node_modules/@docker/actions-toolkit/lib/docker/install.js","../webpack:/docker-setup-docker/node_modules/@docker/actions-toolkit/lib/exec.js","../webpack:/docker-setup-docker/node_modules/@docker/actions-toolkit/lib/github.js","../webpack:/docker-setup-docker/node_modules/@docker/actions-toolkit/lib/index.js","../webpack:/docker-setup-docker/node_modules/@docker/actions-toolkit/lib/util.js","../webpack:/docker-setup-docker/node_modules/@octokit/auth-token/dist-node/index.js","../webpack:/docker-setup-docker/node_modules/@octokit/core/dist-node/index.js","../webpack:/docker-setup-docker/node_modules/@octokit/endpoint/dist-node/index.js","../webpack:/docker-setup-docker/node_modules/@octokit/graphql/dist-node/index.js","../webpack:/docker-setup-docker/node_modules/@octokit/plugin-paginate-rest/dist-node/index.js","../webpack:/docker-setup-docker/node_modules/@octokit/plugin-rest-endpoint-methods/dist-node/index.js","../webpack:/docker-setup-docker/node_modules/@octokit/request-error/dist-node/index.js","../webpack:/docker-setup-docker/node_modules/@octokit/request/dist-node/index.js","../webpack:/docker-setup-docker/node_modules/async-retry/lib/index.js","../webpack:/docker-setup-docker/node_modules/balanced-match/index.js","../webpack:Line truncated
{"version":3,"sources":["../webpack:/docker-setup-docker/node_modules/@actions/core/lib/command.js","../webpack:/docker-setup-docker/node_modules/@actions/core/lib/core.js","../webpack:/docker-setup-docker/node_modules/@actions/core/lib/file-command.js","../webpack:/docker-setup-docker/node_modules/@actions/core/lib/oidc-utils.js","../webpack:/docker-setup-docker/node_modules/@actions/core/lib/path-utils.js","../webpack:/docker-setup-docker/node_modules/@actions/core/lib/summary.js","../webpack:/docker-setup-docker/node_modules/@actions/core/lib/utils.js","../webpack:/docker-setup-docker/node_modules/@actions/core/node_modules/uuid/dist/index.js","../webpack:/docker-setup-docker/node_modules/@actions/core/node_modules/uuid/dist/md5.js","../webpack:/docker-setup-docker/node_modules/@actions/core/node_modules/uuid/dist/nil.js","../webpack:/docker-setup-docker/node_modules/@actions/core/node_modules/uuid/dist/parse.js","../webpack:/docker-setup-docker/node_modules/@actions/core/node_modules/uuid/dist/regex.js","../webpack:/docker-setup-docker/node_modules/@actions/core/node_modules/uuid/dist/rng.js","../webpack:/docker-setup-docker/node_modules/@actions/core/node_modules/uuid/dist/sha1.js","../webpack:/docker-setup-docker/node_modules/@actions/core/node_modules/uuid/dist/stringify.js","../webpack:/docker-setup-docker/node_modules/@actions/core/node_modules/uuid/dist/v1.js","../webpack:/docker-setup-docker/node_modules/@actions/core/node_modules/uuid/dist/v3.js","../webpack:/docker-setup-docker/node_modules/@actions/core/node_modules/uuid/dist/v35.js","../webpack:/docker-setup-docker/node_modules/@actions/core/node_modules/uuid/dist/v4.js","../webpack:/docker-setup-docker/node_modules/@actions/core/node_modules/uuid/dist/v5.js","../webpack:/docker-setup-docker/node_modules/@actions/core/node_modules/uuid/dist/validate.js","../webpack:/docker-setup-docker/node_modules/@actions/core/node_modules/uuid/dist/version.js","../webpack:/docker-setup-docker/node_modules/@actions/exec/lib/exec.js","../webpack:/docker-setup-docker/node_modules/@actions/exec/lib/toolrunner.js","../webpack:/docker-setup-docker/node_modules/@actions/github/lib/context.js","../webpack:/docker-setup-docker/node_modules/@actions/github/lib/github.js","../webpack:/docker-setup-docker/node_modules/@actions/github/lib/internal/utils.js","../webpack:/docker-setup-docker/node_modules/@actions/github/lib/utils.js","../webpack:/docker-setup-docker/node_modules/@actions/http-client/lib/auth.js","../webpack:/docker-setup-docker/node_modules/@actions/http-client/lib/index.js","../webpack:/docker-setup-docker/node_modules/@actions/http-client/lib/proxy.js","../webpack:/docker-setup-docker/node_modules/@actions/io/lib/io-util.js","../webpack:/docker-setup-docker/node_modules/@actions/io/lib/io.js","../webpack:/docker-setup-docker/node_modules/@actions/tool-cache/lib/manifest.js","../webpack:/docker-setup-docker/node_modules/@actions/tool-cache/lib/retry-helper.js","../webpack:/docker-setup-docker/node_modules/@actions/tool-cache/lib/tool-cache.js","../webpack:/docker-setup-docker/node_modules/@actions/tool-cache/node_modules/semver/semver.js","../webpack:/docker-setup-docker/node_modules/@actions/tool-cache/node_modules/uuid/lib/bytesToUuid.js","../webpack:/docker-setup-docker/node_modules/@actions/tool-cache/node_modules/uuid/lib/rng.js","../webpack:/docker-setup-docker/node_modules/@actions/tool-cache/node_modules/uuid/v4.js","../webpack:/docker-setup-docker/node_modules/@docker/actions-toolkit/lib/context.js","../webpack:/docker-setup-docker/node_modules/@docker/actions-toolkit/lib/docker/assets.js","../webpack:/docker-setup-docker/node_modules/@docker/actions-toolkit/lib/docker/docker.js","../webpack:/docker-setup-docker/node_modules/@docker/actions-toolkit/lib/docker/install.js","../webpack:/docker-setup-docker/node_modules/@docker/actions-toolkit/lib/exec.js","../webpack:/docker-setup-docker/node_modules/@docker/actions-toolkit/lib/github.js","../webpack:/docker-setup-docker/node_modules/@docker/actions-toolkit/lib/index.js","../webpack:/docker-setup-docker/node_modules/@docker/actions-toolkit/lib/util.js","../webpack:/docker-setup-docker/node_modules/@octokit/auth-token/dist-node/index.js","../webpack:/docker-setup-docker/node_modules/@octokit/core/dist-node/index.js","../webpack:/docker-setup-docker/node_modules/@octokit/endpoint/dist-node/index.js","../webpack:/docker-setup-docker/node_modules/@octokit/graphql/dist-node/index.js","../webpack:/docker-setup-docker/node_modules/@octokit/plugin-paginate-rest/dist-node/index.js","../webpack:/docker-setup-docker/node_modules/@octokit/plugin-rest-endpoint-methods/dist-node/index.js","../webpack:/docker-setup-docker/node_modules/@octokit/request-error/dist-node/index.js","../webpack:/docker-setup-docker/node_modules/@octokit/request/dist-node/index.js","../webpack:/docker-setup-docker/node_modules/async-retry/lib/index.js","../webpack:/docker-setup-docker/node_modules/balanced-match/index.js","../webpack:Line truncated
+3 -1
View File
@@ -3,11 +3,13 @@ import * as core from '@actions/core';
export interface Inputs {
version: string;
channel: string;
context: string;
}
export function getInputs(): Inputs {
return {
version: core.getInput('version'),
channel: core.getInput('channel')
channel: core.getInput('channel'),
context: core.getInput('context')
};
}
+7 -2
View File
@@ -15,10 +15,15 @@ actionsToolkit.run(
const input: context.Inputs = context.getInputs();
const runDir = path.join(os.homedir(), `setup-docker-action-${uuid.v4()}`);
if (input.context == 'default') {
throw new Error(`'default' context cannot be used.`);
}
const install = new Install({
runDir: runDir,
version: input.version,
channel: input.channel
version: input.version || 'latest',
channel: input.channel || 'stable',
contextName: input.context || 'setup-docker-action'
});
let toolDir;
if (!(await Docker.isAvailable()) || input.version) {