├── .github └── workflows │ └── main.yml ├── .prettierrc ├── LICENSE ├── README.md ├── action.yml ├── node_modules └── @actions │ ├── core │ ├── README.md │ ├── lib │ │ ├── command.d.ts │ │ ├── command.js │ │ ├── command.js.map │ │ ├── core.d.ts │ │ ├── core.js │ │ └── core.js.map │ └── package.json │ ├── exec │ ├── README.md │ ├── lib │ │ ├── exec.d.ts │ │ ├── exec.js │ │ ├── exec.js.map │ │ ├── interfaces.d.ts │ │ ├── interfaces.js │ │ ├── interfaces.js.map │ │ ├── toolrunner.d.ts │ │ ├── toolrunner.js │ │ └── toolrunner.js.map │ └── package.json │ └── io │ ├── README.md │ ├── lib │ ├── io-util.d.ts │ ├── io-util.js │ ├── io-util.js.map │ ├── io.d.ts │ ├── io.js │ └── io.js.map │ └── package.json ├── package-lock.json ├── package.json └── src ├── action.js └── install-dhall.sh /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | name: Example Workflow 2 | 3 | on: push 4 | 5 | jobs: 6 | build: 7 | name: Print Versions 8 | runs-on: ${{ matrix.os }} 9 | strategy: 10 | matrix: 11 | os: 12 | - ubuntu-latest 13 | - macos-latest 14 | version: 15 | - 1.34.0 16 | - latest 17 | steps: 18 | - uses: actions/checkout@v4 19 | 20 | - name: Setup Dhall 21 | uses: ./ 22 | with: 23 | version: ${{ matrix.version }} 24 | github_token: ${{ github.token }} 25 | 26 | - name: Print version 27 | run: | 28 | echo "dhall version: $(dhall version)" 29 | echo "dhall-json version: $(dhall-to-json --version)" 30 | echo "dhall-yaml version: $(dhall-to-yaml --version)" 31 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "trailingComma": "es5", 3 | "tabWidth": 2, 4 | "semi": false, 5 | "singleQuote": true 6 | } 7 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2020 Craig Day 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | 3. Neither the name of the author nor the names of its contributors may be 15 | used to endorse or promote products derived from this software without 16 | specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # setup-dhall 2 | 3 | ![Example Workflow](https://github.com/dhall-lang/setup-dhall/workflows/Example%20Workflow/badge.svg?event=push) 4 | 5 | Github action to install a specific version of https://dhall-lang.org. 6 | 7 | This will add the following executables to your `PATH`, making them available for further actions: 8 | 9 | - `dhall` 10 | - `dhall-to-json` 11 | - `dhall-to-yaml` 12 | - `json-to-dhall` 13 | - `yaml-to-dhall` 14 | 15 | ## Inputs 16 | 17 | | Parameter | Description | Required | Default | 18 | | -------------- | --------------------------------------------------------------------- | -------- | -------- | 19 | | `version` | The version of Dhall to install | N | `latest` | 20 | | `github_token` | A GitHub Token. This can help with rate limits when fetching releases | N | None | 21 | 22 | ## Usage 23 | 24 | ### Basic Example 25 | 26 | ```yaml 27 | jobs: 28 | build: 29 | runs-on: ubuntu-latest 30 | steps: 31 | - uses: dhall-lang/setup-dhall@v4 32 | - run: dhall version 33 | ``` 34 | 35 | ### With a Specific Version 36 | 37 | ```yaml 38 | jobs: 39 | build: 40 | runs-on: ubuntu-latest 41 | steps: 42 | - uses: dhall-lang/setup-dhall@v4 43 | with: 44 | version: '1.28.0' 45 | - run: dhall version 46 | - run: dhall-to-json --version 47 | ``` 48 | 49 | ### Adding a GitHub token 50 | 51 | If the action fails, it could be because GitHub rate limits anonymous requests to the API. In that 52 | case, the action will log an error message that looks something like this: 53 | 54 | ``` 55 | ##[error]Failed to fetch releases from GitHub API, providing a token may help. 56 | Error: {"message":"API rate limit exceeded for 1.1.1.1. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)","documentation_url":"https://developer.github.com/v3/#rate-limiting"} 57 | ``` 58 | 59 | As the error indicates, making the request as an authenticated user will grant a higher rate limit, 60 | so you can provide a `github_token` input to do so. 61 | 62 | ```yaml 63 | jobs: 64 | build: 65 | runs-on: ubuntu-latest 66 | steps: 67 | - uses: dhall-lang/setup-dhall@v4 68 | with: 69 | version: '1.28.0' 70 | github_token: ${{ github.token }} 71 | - run: dhall version 72 | - run: dhall-to-json --version 73 | ``` 74 | 75 | ## TODO 76 | 77 | - [x] Add platform validation on action to fail early if an unsupported runner is used 78 | - [x] Add support for the macOS runner 79 | - [ ] Add support for the Windows runner 80 | -------------------------------------------------------------------------------- /action.yml: -------------------------------------------------------------------------------- 1 | name: Setup Dhall 2 | description: Install a Dhall version, including dhall-json, and provide the binary to run commands. 3 | author: Craig Day 4 | branding: 5 | color: blue 6 | icon: code 7 | 8 | inputs: 9 | version: 10 | description: 'Version of Dhall to use. Default: `latest`' 11 | required: false 12 | default: latest 13 | github_token: 14 | description: A GitHub Token. This can help with rate limits when fetching releases. 15 | required: false 16 | 17 | runs: 18 | using: node20 19 | main: src/action.js 20 | -------------------------------------------------------------------------------- /node_modules/@actions/core/README.md: -------------------------------------------------------------------------------- 1 | # `@actions/core` 2 | 3 | > Core functions for setting results, logging, registering secrets and exporting variables across actions 4 | 5 | ## Usage 6 | 7 | ### Import the package 8 | 9 | ```js 10 | // javascript 11 | const core = require('@actions/core'); 12 | 13 | // typescript 14 | import * as core from '@actions/core'; 15 | ``` 16 | 17 | #### Inputs/Outputs 18 | 19 | Action inputs can be read with `getInput`. Outputs can be set with `setOutput` which makes them available to be mapped into inputs of other actions to ensure they are decoupled. 20 | 21 | ```js 22 | const myInput = core.getInput('inputName', { required: true }); 23 | 24 | core.setOutput('outputKey', 'outputVal'); 25 | ``` 26 | 27 | #### Exporting variables 28 | 29 | Since each step runs in a separate process, you can use `exportVariable` to add it to this step and future steps environment blocks. 30 | 31 | ```js 32 | core.exportVariable('envVar', 'Val'); 33 | ``` 34 | 35 | #### Setting a secret 36 | 37 | Setting a secret registers the secret with the runner to ensure it is masked in logs. 38 | 39 | ```js 40 | core.setSecret('myPassword'); 41 | ``` 42 | 43 | #### PATH Manipulation 44 | 45 | To make a tool's path available in the path for the remainder of the job (without altering the machine or containers state), use `addPath`. The runner will prepend the path given to the jobs PATH. 46 | 47 | ```js 48 | core.addPath('/path/to/mytool'); 49 | ``` 50 | 51 | #### Exit codes 52 | 53 | You should use this library to set the failing exit code for your action. If status is not set and the script runs to completion, that will lead to a success. 54 | 55 | ```js 56 | const core = require('@actions/core'); 57 | 58 | try { 59 | // Do stuff 60 | } 61 | catch (err) { 62 | // setFailed logs the message and sets a failing exit code 63 | core.setFailed(`Action failed with error ${err}`); 64 | } 65 | 66 | Note that `setNeutral` is not yet implemented in actions V2 but equivalent functionality is being planned. 67 | 68 | ``` 69 | 70 | #### Logging 71 | 72 | Finally, this library provides some utilities for logging. Note that debug logging is hidden from the logs by default. This behavior can be toggled by enabling the [Step Debug Logs](../../docs/action-debugging.md#step-debug-logs). 73 | 74 | ```js 75 | const core = require('@actions/core'); 76 | 77 | const myInput = core.getInput('input'); 78 | try { 79 | core.debug('Inside try block'); 80 | 81 | if (!myInput) { 82 | core.warning('myInput was not set'); 83 | } 84 | 85 | if (core.isDebug()) { 86 | // curl -v https://github.com 87 | } else { 88 | // curl https://github.com 89 | } 90 | 91 | // Do stuff 92 | } 93 | catch (err) { 94 | core.error(`Error ${err}, action may still succeed though`); 95 | } 96 | ``` 97 | 98 | This library can also wrap chunks of output in foldable groups. 99 | 100 | ```js 101 | const core = require('@actions/core') 102 | 103 | // Manually wrap output 104 | core.startGroup('Do some function') 105 | doSomeFunction() 106 | core.endGroup() 107 | 108 | // Wrap an asynchronous function call 109 | const result = await core.group('Do something async', async () => { 110 | const response = await doSomeHTTPRequest() 111 | return response 112 | }) 113 | ``` 114 | 115 | #### Action state 116 | 117 | You can use this library to save state and get state for sharing information between a given wrapper action: 118 | 119 | **action.yml** 120 | ```yaml 121 | name: 'Wrapper action sample' 122 | inputs: 123 | name: 124 | default: 'GitHub' 125 | runs: 126 | using: 'node12' 127 | main: 'main.js' 128 | post: 'cleanup.js' 129 | ``` 130 | 131 | In action's `main.js`: 132 | 133 | ```js 134 | const core = require('@actions/core'); 135 | 136 | core.saveState("pidToKill", 12345); 137 | ``` 138 | 139 | In action's `cleanup.js`: 140 | ```js 141 | const core = require('@actions/core'); 142 | 143 | var pid = core.getState("pidToKill"); 144 | 145 | process.kill(pid); 146 | ``` -------------------------------------------------------------------------------- /node_modules/@actions/core/lib/command.d.ts: -------------------------------------------------------------------------------- 1 | interface CommandProperties { 2 | [key: string]: string; 3 | } 4 | /** 5 | * Commands 6 | * 7 | * Command Format: 8 | * ::name key=value,key=value::message 9 | * 10 | * Examples: 11 | * ::warning::This is the message 12 | * ::set-env name=MY_VAR::some value 13 | */ 14 | export declare function issueCommand(command: string, properties: CommandProperties, message: string): void; 15 | export declare function issue(name: string, message?: string): void; 16 | export {}; 17 | -------------------------------------------------------------------------------- /node_modules/@actions/core/lib/command.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var __importStar = (this && this.__importStar) || function (mod) { 3 | if (mod && mod.__esModule) return mod; 4 | var result = {}; 5 | if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; 6 | result["default"] = mod; 7 | return result; 8 | }; 9 | Object.defineProperty(exports, "__esModule", { value: true }); 10 | const os = __importStar(require("os")); 11 | /** 12 | * Commands 13 | * 14 | * Command Format: 15 | * ::name key=value,key=value::message 16 | * 17 | * Examples: 18 | * ::warning::This is the message 19 | * ::set-env name=MY_VAR::some value 20 | */ 21 | function issueCommand(command, properties, message) { 22 | const cmd = new Command(command, properties, message); 23 | process.stdout.write(cmd.toString() + os.EOL); 24 | } 25 | exports.issueCommand = issueCommand; 26 | function issue(name, message = '') { 27 | issueCommand(name, {}, message); 28 | } 29 | exports.issue = issue; 30 | const CMD_STRING = '::'; 31 | class Command { 32 | constructor(command, properties, message) { 33 | if (!command) { 34 | command = 'missing.command'; 35 | } 36 | this.command = command; 37 | this.properties = properties; 38 | this.message = message; 39 | } 40 | toString() { 41 | let cmdStr = CMD_STRING + this.command; 42 | if (this.properties && Object.keys(this.properties).length > 0) { 43 | cmdStr += ' '; 44 | let first = true; 45 | for (const key in this.properties) { 46 | if (this.properties.hasOwnProperty(key)) { 47 | const val = this.properties[key]; 48 | if (val) { 49 | if (first) { 50 | first = false; 51 | } 52 | else { 53 | cmdStr += ','; 54 | } 55 | cmdStr += `${key}=${escapeProperty(val)}`; 56 | } 57 | } 58 | } 59 | } 60 | cmdStr += `${CMD_STRING}${escapeData(this.message)}`; 61 | return cmdStr; 62 | } 63 | } 64 | function escapeData(s) { 65 | return (s || '') 66 | .replace(/%/g, '%25') 67 | .replace(/\r/g, '%0D') 68 | .replace(/\n/g, '%0A'); 69 | } 70 | function escapeProperty(s) { 71 | return (s || '') 72 | .replace(/%/g, '%25') 73 | .replace(/\r/g, '%0D') 74 | .replace(/\n/g, '%0A') 75 | .replace(/:/g, '%3A') 76 | .replace(/,/g, '%2C'); 77 | } 78 | //# sourceMappingURL=command.js.map -------------------------------------------------------------------------------- /node_modules/@actions/core/lib/command.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"command.js","sourceRoot":"","sources":["../src/command.ts"],"names":[],"mappings":";;;;;;;;;AAAA,uCAAwB;AAQxB;;;;;;;;;GASG;AACH,SAAgB,YAAY,CAC1B,OAAe,EACf,UAA6B,EAC7B,OAAe;IAEf,MAAM,GAAG,GAAG,IAAI,OAAO,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,CAAC,CAAA;IACrD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAAA;AAC/C,CAAC;AAPD,oCAOC;AAED,SAAgB,KAAK,CAAC,IAAY,EAAE,UAAkB,EAAE;IACtD,YAAY,CAAC,IAAI,EAAE,EAAE,EAAE,OAAO,CAAC,CAAA;AACjC,CAAC;AAFD,sBAEC;AAED,MAAM,UAAU,GAAG,IAAI,CAAA;AAEvB,MAAM,OAAO;IAKX,YAAY,OAAe,EAAE,UAA6B,EAAE,OAAe;QACzE,IAAI,CAAC,OAAO,EAAE;YACZ,OAAO,GAAG,iBAAiB,CAAA;SAC5B;QAED,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAC5B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IACxB,CAAC;IAED,QAAQ;QACN,IAAI,MAAM,GAAG,UAAU,GAAG,IAAI,CAAC,OAAO,CAAA;QAEtC,IAAI,IAAI,CAAC,UAAU,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE;YAC9D,MAAM,IAAI,GAAG,CAAA;YACb,IAAI,KAAK,GAAG,IAAI,CAAA;YAChB,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,UAAU,EAAE;gBACjC,IAAI,IAAI,CAAC,UAAU,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE;oBACvC,MAAM,GAAG,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;oBAChC,IAAI,GAAG,EAAE;wBACP,IAAI,KAAK,EAAE;4BACT,KAAK,GAAG,KAAK,CAAA;yBACd;6BAAM;4BACL,MAAM,IAAI,GAAG,CAAA;yBACd;wBAED,MAAM,IAAI,GAAG,GAAG,IAAI,cAAc,CAAC,GAAG,CAAC,EAAE,CAAA;qBAC1C;iBACF;aACF;SACF;QAED,MAAM,IAAI,GAAG,UAAU,GAAG,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAA;QACpD,OAAO,MAAM,CAAA;IACf,CAAC;CACF;AAED,SAAS,UAAU,CAAC,CAAS;IAC3B,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC;SACb,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC;SACpB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC;SACrB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAA;AAC1B,CAAC;AAED,SAAS,cAAc,CAAC,CAAS;IAC/B,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC;SACb,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC;SACpB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC;SACrB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC;SACpB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;AACzB,CAAC"} -------------------------------------------------------------------------------- /node_modules/@actions/core/lib/core.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Interface for getInput options 3 | */ 4 | export interface InputOptions { 5 | /** Optional. Whether the input is required. If required and not present, will throw. Defaults to false */ 6 | required?: boolean; 7 | } 8 | /** 9 | * The code to exit an action 10 | */ 11 | export declare enum ExitCode { 12 | /** 13 | * A code indicating that the action was successful 14 | */ 15 | Success = 0, 16 | /** 17 | * A code indicating that the action was a failure 18 | */ 19 | Failure = 1 20 | } 21 | /** 22 | * Sets env variable for this action and future actions in the job 23 | * @param name the name of the variable to set 24 | * @param val the value of the variable 25 | */ 26 | export declare function exportVariable(name: string, val: string): void; 27 | /** 28 | * Registers a secret which will get masked from logs 29 | * @param secret value of the secret 30 | */ 31 | export declare function setSecret(secret: string): void; 32 | /** 33 | * Prepends inputPath to the PATH (for this action and future actions) 34 | * @param inputPath 35 | */ 36 | export declare function addPath(inputPath: string): void; 37 | /** 38 | * Gets the value of an input. The value is also trimmed. 39 | * 40 | * @param name name of the input to get 41 | * @param options optional. See InputOptions. 42 | * @returns string 43 | */ 44 | export declare function getInput(name: string, options?: InputOptions): string; 45 | /** 46 | * Sets the value of an output. 47 | * 48 | * @param name name of the output to set 49 | * @param value value to store 50 | */ 51 | export declare function setOutput(name: string, value: string): void; 52 | /** 53 | * Sets the action status to failed. 54 | * When the action exits it will be with an exit code of 1 55 | * @param message add error issue message 56 | */ 57 | export declare function setFailed(message: string): void; 58 | /** 59 | * Gets whether Actions Step Debug is on or not 60 | */ 61 | export declare function isDebug(): boolean; 62 | /** 63 | * Writes debug message to user log 64 | * @param message debug message 65 | */ 66 | export declare function debug(message: string): void; 67 | /** 68 | * Adds an error issue 69 | * @param message error issue message 70 | */ 71 | export declare function error(message: string): void; 72 | /** 73 | * Adds an warning issue 74 | * @param message warning issue message 75 | */ 76 | export declare function warning(message: string): void; 77 | /** 78 | * Writes info to log with console.log. 79 | * @param message info message 80 | */ 81 | export declare function info(message: string): void; 82 | /** 83 | * Begin an output group. 84 | * 85 | * Output until the next `groupEnd` will be foldable in this group 86 | * 87 | * @param name The name of the output group 88 | */ 89 | export declare function startGroup(name: string): void; 90 | /** 91 | * End an output group. 92 | */ 93 | export declare function endGroup(): void; 94 | /** 95 | * Wrap an asynchronous function call in a group. 96 | * 97 | * Returns the same type as the function itself. 98 | * 99 | * @param name The name of the group 100 | * @param fn The function to wrap in the group 101 | */ 102 | export declare function group(name: string, fn: () => Promise): Promise; 103 | /** 104 | * Saves state for current action, the state can only be retrieved by this action's post job execution. 105 | * 106 | * @param name name of the state to store 107 | * @param value value to store 108 | */ 109 | export declare function saveState(name: string, value: string): void; 110 | /** 111 | * Gets the value of an state set by this action's main execution. 112 | * 113 | * @param name name of the state to get 114 | * @returns string 115 | */ 116 | export declare function getState(name: string): string; 117 | -------------------------------------------------------------------------------- /node_modules/@actions/core/lib/core.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { 3 | function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } 4 | return new (P || (P = Promise))(function (resolve, reject) { 5 | function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } 6 | function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } 7 | function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } 8 | step((generator = generator.apply(thisArg, _arguments || [])).next()); 9 | }); 10 | }; 11 | var __importStar = (this && this.__importStar) || function (mod) { 12 | if (mod && mod.__esModule) return mod; 13 | var result = {}; 14 | if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; 15 | result["default"] = mod; 16 | return result; 17 | }; 18 | Object.defineProperty(exports, "__esModule", { value: true }); 19 | const command_1 = require("./command"); 20 | const os = __importStar(require("os")); 21 | const path = __importStar(require("path")); 22 | /** 23 | * The code to exit an action 24 | */ 25 | var ExitCode; 26 | (function (ExitCode) { 27 | /** 28 | * A code indicating that the action was successful 29 | */ 30 | ExitCode[ExitCode["Success"] = 0] = "Success"; 31 | /** 32 | * A code indicating that the action was a failure 33 | */ 34 | ExitCode[ExitCode["Failure"] = 1] = "Failure"; 35 | })(ExitCode = exports.ExitCode || (exports.ExitCode = {})); 36 | //----------------------------------------------------------------------- 37 | // Variables 38 | //----------------------------------------------------------------------- 39 | /** 40 | * Sets env variable for this action and future actions in the job 41 | * @param name the name of the variable to set 42 | * @param val the value of the variable 43 | */ 44 | function exportVariable(name, val) { 45 | process.env[name] = val; 46 | command_1.issueCommand('set-env', { name }, val); 47 | } 48 | exports.exportVariable = exportVariable; 49 | /** 50 | * Registers a secret which will get masked from logs 51 | * @param secret value of the secret 52 | */ 53 | function setSecret(secret) { 54 | command_1.issueCommand('add-mask', {}, secret); 55 | } 56 | exports.setSecret = setSecret; 57 | /** 58 | * Prepends inputPath to the PATH (for this action and future actions) 59 | * @param inputPath 60 | */ 61 | function addPath(inputPath) { 62 | command_1.issueCommand('add-path', {}, inputPath); 63 | process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`; 64 | } 65 | exports.addPath = addPath; 66 | /** 67 | * Gets the value of an input. The value is also trimmed. 68 | * 69 | * @param name name of the input to get 70 | * @param options optional. See InputOptions. 71 | * @returns string 72 | */ 73 | function getInput(name, options) { 74 | const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || ''; 75 | if (options && options.required && !val) { 76 | throw new Error(`Input required and not supplied: ${name}`); 77 | } 78 | return val.trim(); 79 | } 80 | exports.getInput = getInput; 81 | /** 82 | * Sets the value of an output. 83 | * 84 | * @param name name of the output to set 85 | * @param value value to store 86 | */ 87 | function setOutput(name, value) { 88 | command_1.issueCommand('set-output', { name }, value); 89 | } 90 | exports.setOutput = setOutput; 91 | //----------------------------------------------------------------------- 92 | // Results 93 | //----------------------------------------------------------------------- 94 | /** 95 | * Sets the action status to failed. 96 | * When the action exits it will be with an exit code of 1 97 | * @param message add error issue message 98 | */ 99 | function setFailed(message) { 100 | process.exitCode = ExitCode.Failure; 101 | error(message); 102 | } 103 | exports.setFailed = setFailed; 104 | //----------------------------------------------------------------------- 105 | // Logging Commands 106 | //----------------------------------------------------------------------- 107 | /** 108 | * Gets whether Actions Step Debug is on or not 109 | */ 110 | function isDebug() { 111 | return process.env['RUNNER_DEBUG'] === '1'; 112 | } 113 | exports.isDebug = isDebug; 114 | /** 115 | * Writes debug message to user log 116 | * @param message debug message 117 | */ 118 | function debug(message) { 119 | command_1.issueCommand('debug', {}, message); 120 | } 121 | exports.debug = debug; 122 | /** 123 | * Adds an error issue 124 | * @param message error issue message 125 | */ 126 | function error(message) { 127 | command_1.issue('error', message); 128 | } 129 | exports.error = error; 130 | /** 131 | * Adds an warning issue 132 | * @param message warning issue message 133 | */ 134 | function warning(message) { 135 | command_1.issue('warning', message); 136 | } 137 | exports.warning = warning; 138 | /** 139 | * Writes info to log with console.log. 140 | * @param message info message 141 | */ 142 | function info(message) { 143 | process.stdout.write(message + os.EOL); 144 | } 145 | exports.info = info; 146 | /** 147 | * Begin an output group. 148 | * 149 | * Output until the next `groupEnd` will be foldable in this group 150 | * 151 | * @param name The name of the output group 152 | */ 153 | function startGroup(name) { 154 | command_1.issue('group', name); 155 | } 156 | exports.startGroup = startGroup; 157 | /** 158 | * End an output group. 159 | */ 160 | function endGroup() { 161 | command_1.issue('endgroup'); 162 | } 163 | exports.endGroup = endGroup; 164 | /** 165 | * Wrap an asynchronous function call in a group. 166 | * 167 | * Returns the same type as the function itself. 168 | * 169 | * @param name The name of the group 170 | * @param fn The function to wrap in the group 171 | */ 172 | function group(name, fn) { 173 | return __awaiter(this, void 0, void 0, function* () { 174 | startGroup(name); 175 | let result; 176 | try { 177 | result = yield fn(); 178 | } 179 | finally { 180 | endGroup(); 181 | } 182 | return result; 183 | }); 184 | } 185 | exports.group = group; 186 | //----------------------------------------------------------------------- 187 | // Wrapper action state 188 | //----------------------------------------------------------------------- 189 | /** 190 | * Saves state for current action, the state can only be retrieved by this action's post job execution. 191 | * 192 | * @param name name of the state to store 193 | * @param value value to store 194 | */ 195 | function saveState(name, value) { 196 | command_1.issueCommand('save-state', { name }, value); 197 | } 198 | exports.saveState = saveState; 199 | /** 200 | * Gets the value of an state set by this action's main execution. 201 | * 202 | * @param name name of the state to get 203 | * @returns string 204 | */ 205 | function getState(name) { 206 | return process.env[`STATE_${name}`] || ''; 207 | } 208 | exports.getState = getState; 209 | //# sourceMappingURL=core.js.map -------------------------------------------------------------------------------- /node_modules/@actions/core/lib/core.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"core.js","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,uCAA6C;AAE7C,uCAAwB;AACxB,2CAA4B;AAU5B;;GAEG;AACH,IAAY,QAUX;AAVD,WAAY,QAAQ;IAClB;;OAEG;IACH,6CAAW,CAAA;IAEX;;OAEG;IACH,6CAAW,CAAA;AACb,CAAC,EAVW,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAUnB;AAED,yEAAyE;AACzE,YAAY;AACZ,yEAAyE;AAEzE;;;;GAIG;AACH,SAAgB,cAAc,CAAC,IAAY,EAAE,GAAW;IACtD,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,GAAG,CAAA;IACvB,sBAAY,CAAC,SAAS,EAAE,EAAC,IAAI,EAAC,EAAE,GAAG,CAAC,CAAA;AACtC,CAAC;AAHD,wCAGC;AAED;;;GAGG;AACH,SAAgB,SAAS,CAAC,MAAc;IACtC,sBAAY,CAAC,UAAU,EAAE,EAAE,EAAE,MAAM,CAAC,CAAA;AACtC,CAAC;AAFD,8BAEC;AAED;;;GAGG;AACH,SAAgB,OAAO,CAAC,SAAiB;IACvC,sBAAY,CAAC,UAAU,EAAE,EAAE,EAAE,SAAS,CAAC,CAAA;IACvC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,GAAG,SAAS,GAAG,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAA;AAC7E,CAAC;AAHD,0BAGC;AAED;;;;;;GAMG;AACH,SAAgB,QAAQ,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CAAC,CAAA;AAC3B,CAAC;AAFD,0BAEC;AAED;;;GAGG;AACH,SAAgB,IAAI,CAAC,OAAe;IAClC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,GAAG,EAAE,CAAC,GAAG,CAAC,CAAA;AACxC,CAAC;AAFD,oBAEC;AAED;;;;;;GAMG;AACH,SAAgB,UAAU,CAAC,IAAY;IACrC,eAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;AACtB,CAAC;AAFD,gCAEC;AAED;;GAEG;AACH,SAAgB,QAAQ;IACtB,eAAK,CAAC,UAAU,CAAC,CAAA;AACnB,CAAC;AAFD,4BAEC;AAED;;;;;;;GAOG;AACH,SAAsB,KAAK,CAAI,IAAY,EAAE,EAAoB;;QAC/D,UAAU,CAAC,IAAI,CAAC,CAAA;QAEhB,IAAI,MAAS,CAAA;QAEb,IAAI;YACF,MAAM,GAAG,MAAM,EAAE,EAAE,CAAA;SACpB;gBAAS;YACR,QAAQ,EAAE,CAAA;SACX;QAED,OAAO,MAAM,CAAA;IACf,CAAC;CAAA;AAZD,sBAYC;AAED,yEAAyE;AACzE,uBAAuB;AACvB,yEAAyE;AAEzE;;;;;GAKG;AACH,SAAgB,SAAS,CAAC,IAAY,EAAE,KAAa;IACnD,sBAAY,CAAC,YAAY,EAAE,EAAC,IAAI,EAAC,EAAE,KAAK,CAAC,CAAA;AAC3C,CAAC;AAFD,8BAEC;AAED;;;;;GAKG;AACH,SAAgB,QAAQ,CAAC,IAAY;IACnC,OAAO,OAAO,CAAC,GAAG,CAAC,SAAS,IAAI,EAAE,CAAC,IAAI,EAAE,CAAA;AAC3C,CAAC;AAFD,4BAEC"} -------------------------------------------------------------------------------- /node_modules/@actions/core/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_from": "@actions/core", 3 | "_id": "@actions/core@1.2.3", 4 | "_inBundle": false, 5 | "_integrity": "sha512-Wp4xnyokakM45Uuj4WLUxdsa8fJjKVl1fDTsPbTEcTcuu0Nb26IPQbOtjmnfaCPGcaoPOOqId8H9NapZ8gii4w==", 6 | "_location": "/@actions/core", 7 | "_phantomChildren": {}, 8 | "_requested": { 9 | "type": "tag", 10 | "registry": true, 11 | "raw": "@actions/core", 12 | "name": "@actions/core", 13 | "escapedName": "@actions%2fcore", 14 | "scope": "@actions", 15 | "rawSpec": "", 16 | "saveSpec": null, 17 | "fetchSpec": "latest" 18 | }, 19 | "_requiredBy": [ 20 | "#USER", 21 | "/" 22 | ], 23 | "_resolved": "https://registry.npmjs.org/@actions/core/-/core-1.2.3.tgz", 24 | "_shasum": "e844b4fa0820e206075445079130868f95bfca95", 25 | "_spec": "@actions/core", 26 | "_where": "/Users/cday/Code/setup-dhall", 27 | "bugs": { 28 | "url": "https://github.com/actions/toolkit/issues" 29 | }, 30 | "bundleDependencies": false, 31 | "deprecated": false, 32 | "description": "Actions core lib", 33 | "devDependencies": { 34 | "@types/node": "^12.0.2" 35 | }, 36 | "directories": { 37 | "lib": "lib", 38 | "test": "__tests__" 39 | }, 40 | "files": [ 41 | "lib" 42 | ], 43 | "homepage": "https://github.com/actions/toolkit/tree/master/packages/core", 44 | "keywords": [ 45 | "github", 46 | "actions", 47 | "core" 48 | ], 49 | "license": "MIT", 50 | "main": "lib/core.js", 51 | "name": "@actions/core", 52 | "publishConfig": { 53 | "access": "public" 54 | }, 55 | "repository": { 56 | "type": "git", 57 | "url": "git+https://github.com/actions/toolkit.git", 58 | "directory": "packages/core" 59 | }, 60 | "scripts": { 61 | "audit-moderate": "npm install && npm audit --audit-level=moderate", 62 | "test": "echo \"Error: run tests from root\" && exit 1", 63 | "tsc": "tsc" 64 | }, 65 | "types": "lib/core.d.ts", 66 | "version": "1.2.3" 67 | } 68 | -------------------------------------------------------------------------------- /node_modules/@actions/exec/README.md: -------------------------------------------------------------------------------- 1 | # `@actions/exec` 2 | 3 | ## Usage 4 | 5 | #### Basic 6 | 7 | You can use this package to execute tools in a cross platform way: 8 | 9 | ```js 10 | const exec = require('@actions/exec'); 11 | 12 | await exec.exec('node index.js'); 13 | ``` 14 | 15 | #### Args 16 | 17 | You can also pass in arg arrays: 18 | 19 | ```js 20 | const exec = require('@actions/exec'); 21 | 22 | await exec.exec('node', ['index.js', 'foo=bar']); 23 | ``` 24 | 25 | #### Output/options 26 | 27 | Capture output or specify [other options](https://github.com/actions/toolkit/blob/d9347d4ab99fd507c0b9104b2cf79fb44fcc827d/packages/exec/src/interfaces.ts#L5): 28 | 29 | ```js 30 | const exec = require('@actions/exec'); 31 | 32 | let myOutput = ''; 33 | let myError = ''; 34 | 35 | const options = {}; 36 | options.listeners = { 37 | stdout: (data: Buffer) => { 38 | myOutput += data.toString(); 39 | }, 40 | stderr: (data: Buffer) => { 41 | myError += data.toString(); 42 | } 43 | }; 44 | options.cwd = './lib'; 45 | 46 | await exec.exec('node', ['index.js', 'foo=bar'], options); 47 | ``` 48 | 49 | #### Exec tools not in the PATH 50 | 51 | You can specify the full path for tools not in the PATH: 52 | 53 | ```js 54 | const exec = require('@actions/exec'); 55 | 56 | await exec.exec('"/path/to/my-tool"', ['arg1']); 57 | ``` 58 | -------------------------------------------------------------------------------- /node_modules/@actions/exec/lib/exec.d.ts: -------------------------------------------------------------------------------- 1 | import * as im from './interfaces'; 2 | /** 3 | * Exec a command. 4 | * Output will be streamed to the live console. 5 | * Returns promise with return code 6 | * 7 | * @param commandLine command to execute (can include additional args). Must be correctly escaped. 8 | * @param args optional arguments for tool. Escaping is handled by the lib. 9 | * @param options optional exec options. See ExecOptions 10 | * @returns Promise exit code 11 | */ 12 | export declare function exec(commandLine: string, args?: string[], options?: im.ExecOptions): Promise; 13 | -------------------------------------------------------------------------------- /node_modules/@actions/exec/lib/exec.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { 3 | function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } 4 | return new (P || (P = Promise))(function (resolve, reject) { 5 | function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } 6 | function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } 7 | function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } 8 | step((generator = generator.apply(thisArg, _arguments || [])).next()); 9 | }); 10 | }; 11 | Object.defineProperty(exports, "__esModule", { value: true }); 12 | const tr = require("./toolrunner"); 13 | /** 14 | * Exec a command. 15 | * Output will be streamed to the live console. 16 | * Returns promise with return code 17 | * 18 | * @param commandLine command to execute (can include additional args). Must be correctly escaped. 19 | * @param args optional arguments for tool. Escaping is handled by the lib. 20 | * @param options optional exec options. See ExecOptions 21 | * @returns Promise exit code 22 | */ 23 | function exec(commandLine, args, options) { 24 | return __awaiter(this, void 0, void 0, function* () { 25 | const commandArgs = tr.argStringToArray(commandLine); 26 | if (commandArgs.length === 0) { 27 | throw new Error(`Parameter 'commandLine' cannot be null or empty.`); 28 | } 29 | // Path to tool to execute should be first arg 30 | const toolPath = commandArgs[0]; 31 | args = commandArgs.slice(1).concat(args || []); 32 | const runner = new tr.ToolRunner(toolPath, args, options); 33 | return runner.exec(); 34 | }); 35 | } 36 | exports.exec = exec; 37 | //# sourceMappingURL=exec.js.map -------------------------------------------------------------------------------- /node_modules/@actions/exec/lib/exec.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"exec.js","sourceRoot":"","sources":["../src/exec.ts"],"names":[],"mappings":";;;;;;;;;;;AACA,mCAAkC;AAElC;;;;;;;;;GASG;AACH,SAAsB,IAAI,CACxB,WAAmB,EACnB,IAAe,EACf,OAAwB;;QAExB,MAAM,WAAW,GAAG,EAAE,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAA;QACpD,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE;YAC5B,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAA;SACpE;QACD,8CAA8C;QAC9C,MAAM,QAAQ,GAAG,WAAW,CAAC,CAAC,CAAC,CAAA;QAC/B,IAAI,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC,CAAA;QAC9C,MAAM,MAAM,GAAkB,IAAI,EAAE,CAAC,UAAU,CAAC,QAAQ,EAAE,IAAI,EAAE,OAAO,CAAC,CAAA;QACxE,OAAO,MAAM,CAAC,IAAI,EAAE,CAAA;IACtB,CAAC;CAAA;AAdD,oBAcC"} -------------------------------------------------------------------------------- /node_modules/@actions/exec/lib/interfaces.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import * as stream from 'stream'; 3 | /** 4 | * Interface for exec options 5 | */ 6 | export interface ExecOptions { 7 | /** optional working directory. defaults to current */ 8 | cwd?: string; 9 | /** optional envvar dictionary. defaults to current process's env */ 10 | env?: { 11 | [key: string]: string; 12 | }; 13 | /** optional. defaults to false */ 14 | silent?: boolean; 15 | /** optional out stream to use. Defaults to process.stdout */ 16 | outStream?: stream.Writable; 17 | /** optional err stream to use. Defaults to process.stderr */ 18 | errStream?: stream.Writable; 19 | /** optional. whether to skip quoting/escaping arguments if needed. defaults to false. */ 20 | windowsVerbatimArguments?: boolean; 21 | /** optional. whether to fail if output to stderr. defaults to false */ 22 | failOnStdErr?: boolean; 23 | /** optional. defaults to failing on non zero. ignore will not fail leaving it up to the caller */ 24 | ignoreReturnCode?: boolean; 25 | /** optional. How long in ms to wait for STDIO streams to close after the exit event of the process before terminating. defaults to 10000 */ 26 | delay?: number; 27 | /** optional. Listeners for output. Callback functions that will be called on these events */ 28 | listeners?: { 29 | stdout?: (data: Buffer) => void; 30 | stderr?: (data: Buffer) => void; 31 | stdline?: (data: string) => void; 32 | errline?: (data: string) => void; 33 | debug?: (data: string) => void; 34 | }; 35 | } 36 | -------------------------------------------------------------------------------- /node_modules/@actions/exec/lib/interfaces.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | //# sourceMappingURL=interfaces.js.map -------------------------------------------------------------------------------- /node_modules/@actions/exec/lib/interfaces.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":""} -------------------------------------------------------------------------------- /node_modules/@actions/exec/lib/toolrunner.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import * as events from 'events'; 3 | import * as im from './interfaces'; 4 | export declare class ToolRunner extends events.EventEmitter { 5 | constructor(toolPath: string, args?: string[], options?: im.ExecOptions); 6 | private toolPath; 7 | private args; 8 | private options; 9 | private _debug; 10 | private _getCommandString; 11 | private _processLineBuffer; 12 | private _getSpawnFileName; 13 | private _getSpawnArgs; 14 | private _endsWith; 15 | private _isCmdFile; 16 | private _windowsQuoteCmdArg; 17 | private _uvQuoteCmdArg; 18 | private _cloneExecOptions; 19 | private _getSpawnOptions; 20 | /** 21 | * Exec a tool. 22 | * Output will be streamed to the live console. 23 | * Returns promise with return code 24 | * 25 | * @param tool path to tool to exec 26 | * @param options optional exec options. See ExecOptions 27 | * @returns number 28 | */ 29 | exec(): Promise; 30 | } 31 | /** 32 | * Convert an arg string to an array of args. Handles escaping 33 | * 34 | * @param argString string of arguments 35 | * @returns string[] array of arguments 36 | */ 37 | export declare function argStringToArray(argString: string): string[]; 38 | -------------------------------------------------------------------------------- /node_modules/@actions/exec/lib/toolrunner.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { 3 | function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } 4 | return new (P || (P = Promise))(function (resolve, reject) { 5 | function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } 6 | function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } 7 | function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } 8 | step((generator = generator.apply(thisArg, _arguments || [])).next()); 9 | }); 10 | }; 11 | Object.defineProperty(exports, "__esModule", { value: true }); 12 | const os = require("os"); 13 | const events = require("events"); 14 | const child = require("child_process"); 15 | const path = require("path"); 16 | const io = require("@actions/io"); 17 | const ioUtil = require("@actions/io/lib/io-util"); 18 | /* eslint-disable @typescript-eslint/unbound-method */ 19 | const IS_WINDOWS = process.platform === 'win32'; 20 | /* 21 | * Class for running command line tools. Handles quoting and arg parsing in a platform agnostic way. 22 | */ 23 | class ToolRunner extends events.EventEmitter { 24 | constructor(toolPath, args, options) { 25 | super(); 26 | if (!toolPath) { 27 | throw new Error("Parameter 'toolPath' cannot be null or empty."); 28 | } 29 | this.toolPath = toolPath; 30 | this.args = args || []; 31 | this.options = options || {}; 32 | } 33 | _debug(message) { 34 | if (this.options.listeners && this.options.listeners.debug) { 35 | this.options.listeners.debug(message); 36 | } 37 | } 38 | _getCommandString(options, noPrefix) { 39 | const toolPath = this._getSpawnFileName(); 40 | const args = this._getSpawnArgs(options); 41 | let cmd = noPrefix ? '' : '[command]'; // omit prefix when piped to a second tool 42 | if (IS_WINDOWS) { 43 | // Windows + cmd file 44 | if (this._isCmdFile()) { 45 | cmd += toolPath; 46 | for (const a of args) { 47 | cmd += ` ${a}`; 48 | } 49 | } 50 | // Windows + verbatim 51 | else if (options.windowsVerbatimArguments) { 52 | cmd += `"${toolPath}"`; 53 | for (const a of args) { 54 | cmd += ` ${a}`; 55 | } 56 | } 57 | // Windows (regular) 58 | else { 59 | cmd += this._windowsQuoteCmdArg(toolPath); 60 | for (const a of args) { 61 | cmd += ` ${this._windowsQuoteCmdArg(a)}`; 62 | } 63 | } 64 | } 65 | else { 66 | // OSX/Linux - this can likely be improved with some form of quoting. 67 | // creating processes on Unix is fundamentally different than Windows. 68 | // on Unix, execvp() takes an arg array. 69 | cmd += toolPath; 70 | for (const a of args) { 71 | cmd += ` ${a}`; 72 | } 73 | } 74 | return cmd; 75 | } 76 | _processLineBuffer(data, strBuffer, onLine) { 77 | try { 78 | let s = strBuffer + data.toString(); 79 | let n = s.indexOf(os.EOL); 80 | while (n > -1) { 81 | const line = s.substring(0, n); 82 | onLine(line); 83 | // the rest of the string ... 84 | s = s.substring(n + os.EOL.length); 85 | n = s.indexOf(os.EOL); 86 | } 87 | strBuffer = s; 88 | } 89 | catch (err) { 90 | // streaming lines to console is best effort. Don't fail a build. 91 | this._debug(`error processing line. Failed with error ${err}`); 92 | } 93 | } 94 | _getSpawnFileName() { 95 | if (IS_WINDOWS) { 96 | if (this._isCmdFile()) { 97 | return process.env['COMSPEC'] || 'cmd.exe'; 98 | } 99 | } 100 | return this.toolPath; 101 | } 102 | _getSpawnArgs(options) { 103 | if (IS_WINDOWS) { 104 | if (this._isCmdFile()) { 105 | let argline = `/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`; 106 | for (const a of this.args) { 107 | argline += ' '; 108 | argline += options.windowsVerbatimArguments 109 | ? a 110 | : this._windowsQuoteCmdArg(a); 111 | } 112 | argline += '"'; 113 | return [argline]; 114 | } 115 | } 116 | return this.args; 117 | } 118 | _endsWith(str, end) { 119 | return str.endsWith(end); 120 | } 121 | _isCmdFile() { 122 | const upperToolPath = this.toolPath.toUpperCase(); 123 | return (this._endsWith(upperToolPath, '.CMD') || 124 | this._endsWith(upperToolPath, '.BAT')); 125 | } 126 | _windowsQuoteCmdArg(arg) { 127 | // for .exe, apply the normal quoting rules that libuv applies 128 | if (!this._isCmdFile()) { 129 | return this._uvQuoteCmdArg(arg); 130 | } 131 | // otherwise apply quoting rules specific to the cmd.exe command line parser. 132 | // the libuv rules are generic and are not designed specifically for cmd.exe 133 | // command line parser. 134 | // 135 | // for a detailed description of the cmd.exe command line parser, refer to 136 | // http://stackoverflow.com/questions/4094699/how-does-the-windows-command-interpreter-cmd-exe-parse-scripts/7970912#7970912 137 | // need quotes for empty arg 138 | if (!arg) { 139 | return '""'; 140 | } 141 | // determine whether the arg needs to be quoted 142 | const cmdSpecialChars = [ 143 | ' ', 144 | '\t', 145 | '&', 146 | '(', 147 | ')', 148 | '[', 149 | ']', 150 | '{', 151 | '}', 152 | '^', 153 | '=', 154 | ';', 155 | '!', 156 | "'", 157 | '+', 158 | ',', 159 | '`', 160 | '~', 161 | '|', 162 | '<', 163 | '>', 164 | '"' 165 | ]; 166 | let needsQuotes = false; 167 | for (const char of arg) { 168 | if (cmdSpecialChars.some(x => x === char)) { 169 | needsQuotes = true; 170 | break; 171 | } 172 | } 173 | // short-circuit if quotes not needed 174 | if (!needsQuotes) { 175 | return arg; 176 | } 177 | // the following quoting rules are very similar to the rules that by libuv applies. 178 | // 179 | // 1) wrap the string in quotes 180 | // 181 | // 2) double-up quotes - i.e. " => "" 182 | // 183 | // this is different from the libuv quoting rules. libuv replaces " with \", which unfortunately 184 | // doesn't work well with a cmd.exe command line. 185 | // 186 | // note, replacing " with "" also works well if the arg is passed to a downstream .NET console app. 187 | // for example, the command line: 188 | // foo.exe "myarg:""my val""" 189 | // is parsed by a .NET console app into an arg array: 190 | // [ "myarg:\"my val\"" ] 191 | // which is the same end result when applying libuv quoting rules. although the actual 192 | // command line from libuv quoting rules would look like: 193 | // foo.exe "myarg:\"my val\"" 194 | // 195 | // 3) double-up slashes that precede a quote, 196 | // e.g. hello \world => "hello \world" 197 | // hello\"world => "hello\\""world" 198 | // hello\\"world => "hello\\\\""world" 199 | // hello world\ => "hello world\\" 200 | // 201 | // technically this is not required for a cmd.exe command line, or the batch argument parser. 202 | // the reasons for including this as a .cmd quoting rule are: 203 | // 204 | // a) this is optimized for the scenario where the argument is passed from the .cmd file to an 205 | // external program. many programs (e.g. .NET console apps) rely on the slash-doubling rule. 206 | // 207 | // b) it's what we've been doing previously (by deferring to node default behavior) and we 208 | // haven't heard any complaints about that aspect. 209 | // 210 | // note, a weakness of the quoting rules chosen here, is that % is not escaped. in fact, % cannot be 211 | // escaped when used on the command line directly - even though within a .cmd file % can be escaped 212 | // by using %%. 213 | // 214 | // the saving grace is, on the command line, %var% is left as-is if var is not defined. this contrasts 215 | // the line parsing rules within a .cmd file, where if var is not defined it is replaced with nothing. 216 | // 217 | // one option that was explored was replacing % with ^% - i.e. %var% => ^%var^%. this hack would 218 | // often work, since it is unlikely that var^ would exist, and the ^ character is removed when the 219 | // variable is used. the problem, however, is that ^ is not removed when %* is used to pass the args 220 | // to an external program. 221 | // 222 | // an unexplored potential solution for the % escaping problem, is to create a wrapper .cmd file. 223 | // % can be escaped within a .cmd file. 224 | let reverse = '"'; 225 | let quoteHit = true; 226 | for (let i = arg.length; i > 0; i--) { 227 | // walk the string in reverse 228 | reverse += arg[i - 1]; 229 | if (quoteHit && arg[i - 1] === '\\') { 230 | reverse += '\\'; // double the slash 231 | } 232 | else if (arg[i - 1] === '"') { 233 | quoteHit = true; 234 | reverse += '"'; // double the quote 235 | } 236 | else { 237 | quoteHit = false; 238 | } 239 | } 240 | reverse += '"'; 241 | return reverse 242 | .split('') 243 | .reverse() 244 | .join(''); 245 | } 246 | _uvQuoteCmdArg(arg) { 247 | // Tool runner wraps child_process.spawn() and needs to apply the same quoting as 248 | // Node in certain cases where the undocumented spawn option windowsVerbatimArguments 249 | // is used. 250 | // 251 | // Since this function is a port of quote_cmd_arg from Node 4.x (technically, lib UV, 252 | // see https://github.com/nodejs/node/blob/v4.x/deps/uv/src/win/process.c for details), 253 | // pasting copyright notice from Node within this function: 254 | // 255 | // Copyright Joyent, Inc. and other Node contributors. All rights reserved. 256 | // 257 | // Permission is hereby granted, free of charge, to any person obtaining a copy 258 | // of this software and associated documentation files (the "Software"), to 259 | // deal in the Software without restriction, including without limitation the 260 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 261 | // sell copies of the Software, and to permit persons to whom the Software is 262 | // furnished to do so, subject to the following conditions: 263 | // 264 | // The above copyright notice and this permission notice shall be included in 265 | // all copies or substantial portions of the Software. 266 | // 267 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 268 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 269 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 270 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 271 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 272 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 273 | // IN THE SOFTWARE. 274 | if (!arg) { 275 | // Need double quotation for empty argument 276 | return '""'; 277 | } 278 | if (!arg.includes(' ') && !arg.includes('\t') && !arg.includes('"')) { 279 | // No quotation needed 280 | return arg; 281 | } 282 | if (!arg.includes('"') && !arg.includes('\\')) { 283 | // No embedded double quotes or backslashes, so I can just wrap 284 | // quote marks around the whole thing. 285 | return `"${arg}"`; 286 | } 287 | // Expected input/output: 288 | // input : hello"world 289 | // output: "hello\"world" 290 | // input : hello""world 291 | // output: "hello\"\"world" 292 | // input : hello\world 293 | // output: hello\world 294 | // input : hello\\world 295 | // output: hello\\world 296 | // input : hello\"world 297 | // output: "hello\\\"world" 298 | // input : hello\\"world 299 | // output: "hello\\\\\"world" 300 | // input : hello world\ 301 | // output: "hello world\\" - note the comment in libuv actually reads "hello world\" 302 | // but it appears the comment is wrong, it should be "hello world\\" 303 | let reverse = '"'; 304 | let quoteHit = true; 305 | for (let i = arg.length; i > 0; i--) { 306 | // walk the string in reverse 307 | reverse += arg[i - 1]; 308 | if (quoteHit && arg[i - 1] === '\\') { 309 | reverse += '\\'; 310 | } 311 | else if (arg[i - 1] === '"') { 312 | quoteHit = true; 313 | reverse += '\\'; 314 | } 315 | else { 316 | quoteHit = false; 317 | } 318 | } 319 | reverse += '"'; 320 | return reverse 321 | .split('') 322 | .reverse() 323 | .join(''); 324 | } 325 | _cloneExecOptions(options) { 326 | options = options || {}; 327 | const result = { 328 | cwd: options.cwd || process.cwd(), 329 | env: options.env || process.env, 330 | silent: options.silent || false, 331 | windowsVerbatimArguments: options.windowsVerbatimArguments || false, 332 | failOnStdErr: options.failOnStdErr || false, 333 | ignoreReturnCode: options.ignoreReturnCode || false, 334 | delay: options.delay || 10000 335 | }; 336 | result.outStream = options.outStream || process.stdout; 337 | result.errStream = options.errStream || process.stderr; 338 | return result; 339 | } 340 | _getSpawnOptions(options, toolPath) { 341 | options = options || {}; 342 | const result = {}; 343 | result.cwd = options.cwd; 344 | result.env = options.env; 345 | result['windowsVerbatimArguments'] = 346 | options.windowsVerbatimArguments || this._isCmdFile(); 347 | if (options.windowsVerbatimArguments) { 348 | result.argv0 = `"${toolPath}"`; 349 | } 350 | return result; 351 | } 352 | /** 353 | * Exec a tool. 354 | * Output will be streamed to the live console. 355 | * Returns promise with return code 356 | * 357 | * @param tool path to tool to exec 358 | * @param options optional exec options. See ExecOptions 359 | * @returns number 360 | */ 361 | exec() { 362 | return __awaiter(this, void 0, void 0, function* () { 363 | // root the tool path if it is unrooted and contains relative pathing 364 | if (!ioUtil.isRooted(this.toolPath) && 365 | (this.toolPath.includes('/') || 366 | (IS_WINDOWS && this.toolPath.includes('\\')))) { 367 | // prefer options.cwd if it is specified, however options.cwd may also need to be rooted 368 | this.toolPath = path.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); 369 | } 370 | // if the tool is only a file name, then resolve it from the PATH 371 | // otherwise verify it exists (add extension on Windows if necessary) 372 | this.toolPath = yield io.which(this.toolPath, true); 373 | return new Promise((resolve, reject) => { 374 | this._debug(`exec tool: ${this.toolPath}`); 375 | this._debug('arguments:'); 376 | for (const arg of this.args) { 377 | this._debug(` ${arg}`); 378 | } 379 | const optionsNonNull = this._cloneExecOptions(this.options); 380 | if (!optionsNonNull.silent && optionsNonNull.outStream) { 381 | optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os.EOL); 382 | } 383 | const state = new ExecState(optionsNonNull, this.toolPath); 384 | state.on('debug', (message) => { 385 | this._debug(message); 386 | }); 387 | const fileName = this._getSpawnFileName(); 388 | const cp = child.spawn(fileName, this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(this.options, fileName)); 389 | const stdbuffer = ''; 390 | if (cp.stdout) { 391 | cp.stdout.on('data', (data) => { 392 | if (this.options.listeners && this.options.listeners.stdout) { 393 | this.options.listeners.stdout(data); 394 | } 395 | if (!optionsNonNull.silent && optionsNonNull.outStream) { 396 | optionsNonNull.outStream.write(data); 397 | } 398 | this._processLineBuffer(data, stdbuffer, (line) => { 399 | if (this.options.listeners && this.options.listeners.stdline) { 400 | this.options.listeners.stdline(line); 401 | } 402 | }); 403 | }); 404 | } 405 | const errbuffer = ''; 406 | if (cp.stderr) { 407 | cp.stderr.on('data', (data) => { 408 | state.processStderr = true; 409 | if (this.options.listeners && this.options.listeners.stderr) { 410 | this.options.listeners.stderr(data); 411 | } 412 | if (!optionsNonNull.silent && 413 | optionsNonNull.errStream && 414 | optionsNonNull.outStream) { 415 | const s = optionsNonNull.failOnStdErr 416 | ? optionsNonNull.errStream 417 | : optionsNonNull.outStream; 418 | s.write(data); 419 | } 420 | this._processLineBuffer(data, errbuffer, (line) => { 421 | if (this.options.listeners && this.options.listeners.errline) { 422 | this.options.listeners.errline(line); 423 | } 424 | }); 425 | }); 426 | } 427 | cp.on('error', (err) => { 428 | state.processError = err.message; 429 | state.processExited = true; 430 | state.processClosed = true; 431 | state.CheckComplete(); 432 | }); 433 | cp.on('exit', (code) => { 434 | state.processExitCode = code; 435 | state.processExited = true; 436 | this._debug(`Exit code ${code} received from tool '${this.toolPath}'`); 437 | state.CheckComplete(); 438 | }); 439 | cp.on('close', (code) => { 440 | state.processExitCode = code; 441 | state.processExited = true; 442 | state.processClosed = true; 443 | this._debug(`STDIO streams have closed for tool '${this.toolPath}'`); 444 | state.CheckComplete(); 445 | }); 446 | state.on('done', (error, exitCode) => { 447 | if (stdbuffer.length > 0) { 448 | this.emit('stdline', stdbuffer); 449 | } 450 | if (errbuffer.length > 0) { 451 | this.emit('errline', errbuffer); 452 | } 453 | cp.removeAllListeners(); 454 | if (error) { 455 | reject(error); 456 | } 457 | else { 458 | resolve(exitCode); 459 | } 460 | }); 461 | }); 462 | }); 463 | } 464 | } 465 | exports.ToolRunner = ToolRunner; 466 | /** 467 | * Convert an arg string to an array of args. Handles escaping 468 | * 469 | * @param argString string of arguments 470 | * @returns string[] array of arguments 471 | */ 472 | function argStringToArray(argString) { 473 | const args = []; 474 | let inQuotes = false; 475 | let escaped = false; 476 | let arg = ''; 477 | function append(c) { 478 | // we only escape double quotes. 479 | if (escaped && c !== '"') { 480 | arg += '\\'; 481 | } 482 | arg += c; 483 | escaped = false; 484 | } 485 | for (let i = 0; i < argString.length; i++) { 486 | const c = argString.charAt(i); 487 | if (c === '"') { 488 | if (!escaped) { 489 | inQuotes = !inQuotes; 490 | } 491 | else { 492 | append(c); 493 | } 494 | continue; 495 | } 496 | if (c === '\\' && escaped) { 497 | append(c); 498 | continue; 499 | } 500 | if (c === '\\' && inQuotes) { 501 | escaped = true; 502 | continue; 503 | } 504 | if (c === ' ' && !inQuotes) { 505 | if (arg.length > 0) { 506 | args.push(arg); 507 | arg = ''; 508 | } 509 | continue; 510 | } 511 | append(c); 512 | } 513 | if (arg.length > 0) { 514 | args.push(arg.trim()); 515 | } 516 | return args; 517 | } 518 | exports.argStringToArray = argStringToArray; 519 | class ExecState extends events.EventEmitter { 520 | constructor(options, toolPath) { 521 | super(); 522 | this.processClosed = false; // tracks whether the process has exited and stdio is closed 523 | this.processError = ''; 524 | this.processExitCode = 0; 525 | this.processExited = false; // tracks whether the process has exited 526 | this.processStderr = false; // tracks whether stderr was written to 527 | this.delay = 10000; // 10 seconds 528 | this.done = false; 529 | this.timeout = null; 530 | if (!toolPath) { 531 | throw new Error('toolPath must not be empty'); 532 | } 533 | this.options = options; 534 | this.toolPath = toolPath; 535 | if (options.delay) { 536 | this.delay = options.delay; 537 | } 538 | } 539 | CheckComplete() { 540 | if (this.done) { 541 | return; 542 | } 543 | if (this.processClosed) { 544 | this._setResult(); 545 | } 546 | else if (this.processExited) { 547 | this.timeout = setTimeout(ExecState.HandleTimeout, this.delay, this); 548 | } 549 | } 550 | _debug(message) { 551 | this.emit('debug', message); 552 | } 553 | _setResult() { 554 | // determine whether there is an error 555 | let error; 556 | if (this.processExited) { 557 | if (this.processError) { 558 | error = new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`); 559 | } 560 | else if (this.processExitCode !== 0 && !this.options.ignoreReturnCode) { 561 | error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`); 562 | } 563 | else if (this.processStderr && this.options.failOnStdErr) { 564 | error = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`); 565 | } 566 | } 567 | // clear the timeout 568 | if (this.timeout) { 569 | clearTimeout(this.timeout); 570 | this.timeout = null; 571 | } 572 | this.done = true; 573 | this.emit('done', error, this.processExitCode); 574 | } 575 | static HandleTimeout(state) { 576 | if (state.done) { 577 | return; 578 | } 579 | if (!state.processClosed && state.processExited) { 580 | const message = `The STDIO streams did not close within ${state.delay / 581 | 1000} seconds of the exit event from process '${state.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`; 582 | state._debug(message); 583 | } 584 | state._setResult(); 585 | } 586 | } 587 | //# sourceMappingURL=toolrunner.js.map -------------------------------------------------------------------------------- /node_modules/@actions/exec/lib/toolrunner.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"toolrunner.js","sourceRoot":"","sources":["../src/toolrunner.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,yBAAwB;AACxB,iCAAgC;AAChC,uCAAsC;AACtC,6BAA4B;AAG5B,kCAAiC;AACjC,kDAAiD;AAEjD,sDAAsD;AAEtD,MAAM,UAAU,GAAG,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAA;AAE/C;;GAEG;AACH,MAAa,UAAW,SAAQ,MAAM,CAAC,YAAY;IACjD,YAAY,QAAgB,EAAE,IAAe,EAAE,OAAwB;QACrE,KAAK,EAAE,CAAA;QAEP,IAAI,CAAC,QAAQ,EAAE;YACb,MAAM,IAAI,KAAK,C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3J,CAAA;aACF;iBAAM,IAAI,IAAI,CAAC,eAAe,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,gBAAgB,EAAE;gBACvE,KAAK,GAAG,IAAI,KAAK,CACf,gBAAgB,IAAI,CAAC,QAAQ,2BAA2B,IAAI,CAAC,eAAe,EAAE,CAC/E,CAAA;aACF;iBAAM,IAAI,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE;gBAC1D,KAAK,GAAG,IAAI,KAAK,CACf,gBAAgB,IAAI,CAAC,QAAQ,sEAAsE,CACpG,CAAA;aACF;SACF;QAED,oBAAoB;QACpB,IAAI,IAAI,CAAC,OAAO,EAAE;YAChB,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;YAC1B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAA;SACpB;QAED,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAChB,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,eAAe,CAAC,CAAA;IAChD,CAAC;IAEO,MAAM,CAAC,aAAa,CAAC,KAAgB;QAC3C,IAAI,KAAK,CAAC,IAAI,EAAE;YACd,OAAM;SACP;QAED,IAAI,CAAC,KAAK,CAAC,aAAa,IAAI,KAAK,CAAC,aAAa,EAAE;YAC/C,MAAM,OAAO,GAAG,0CAA0C,KAAK,CAAC,KAAK;gBACnE,IAAI,4CACJ,KAAK,CAAC,QACR,0FAA0F,CAAA;YAC1F,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;SACtB;QAED,KAAK,CAAC,UAAU,EAAE,CAAA;IACpB,CAAC;CACF"} -------------------------------------------------------------------------------- /node_modules/@actions/exec/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_from": "@actions/exec", 3 | "_id": "@actions/exec@1.0.3", 4 | "_inBundle": false, 5 | "_integrity": "sha512-TogJGnueOmM7ntCi0ASTUj4LapRRtDfj57Ja4IhPmg2fls28uVOPbAn8N+JifaOumN2UG3oEO/Ixek2A4NcYSA==", 6 | "_location": "/@actions/exec", 7 | "_phantomChildren": {}, 8 | "_requested": { 9 | "type": "tag", 10 | "registry": true, 11 | "raw": "@actions/exec", 12 | "name": "@actions/exec", 13 | "escapedName": "@actions%2fexec", 14 | "scope": "@actions", 15 | "rawSpec": "", 16 | "saveSpec": null, 17 | "fetchSpec": "latest" 18 | }, 19 | "_requiredBy": [ 20 | "#USER", 21 | "/" 22 | ], 23 | "_resolved": "https://registry.npmjs.org/@actions/exec/-/exec-1.0.3.tgz", 24 | "_shasum": "b967f8700d6ff011dcc91243b58bafc1bb9ab95f", 25 | "_spec": "@actions/exec", 26 | "_where": "/Users/cday/Code/setup-dhall", 27 | "bugs": { 28 | "url": "https://github.com/actions/toolkit/issues" 29 | }, 30 | "bundleDependencies": false, 31 | "dependencies": { 32 | "@actions/io": "^1.0.1" 33 | }, 34 | "deprecated": false, 35 | "description": "Actions exec lib", 36 | "directories": { 37 | "lib": "lib", 38 | "test": "__tests__" 39 | }, 40 | "files": [ 41 | "lib" 42 | ], 43 | "homepage": "https://github.com/actions/toolkit/tree/master/packages/exec", 44 | "keywords": [ 45 | "github", 46 | "actions", 47 | "exec" 48 | ], 49 | "license": "MIT", 50 | "main": "lib/exec.js", 51 | "name": "@actions/exec", 52 | "publishConfig": { 53 | "access": "public" 54 | }, 55 | "repository": { 56 | "type": "git", 57 | "url": "git+https://github.com/actions/toolkit.git", 58 | "directory": "packages/exec" 59 | }, 60 | "scripts": { 61 | "audit-moderate": "npm install && npm audit --audit-level=moderate", 62 | "test": "echo \"Error: run tests from root\" && exit 1", 63 | "tsc": "tsc" 64 | }, 65 | "types": "lib/exec.d.ts", 66 | "version": "1.0.3" 67 | } 68 | -------------------------------------------------------------------------------- /node_modules/@actions/io/README.md: -------------------------------------------------------------------------------- 1 | # `@actions/io` 2 | 3 | > Core functions for cli filesystem scenarios 4 | 5 | ## Usage 6 | 7 | #### mkdir -p 8 | 9 | Recursively make a directory. Follows rules specified in [man mkdir](https://linux.die.net/man/1/mkdir) with the `-p` option specified: 10 | 11 | ```js 12 | const io = require('@actions/io'); 13 | 14 | await io.mkdirP('path/to/make'); 15 | ``` 16 | 17 | #### cp/mv 18 | 19 | Copy or move files or folders. Follows rules specified in [man cp](https://linux.die.net/man/1/cp) and [man mv](https://linux.die.net/man/1/mv): 20 | 21 | ```js 22 | const io = require('@actions/io'); 23 | 24 | // Recursive must be true for directories 25 | const options = { recursive: true, force: false } 26 | 27 | await io.cp('path/to/directory', 'path/to/dest', options); 28 | await io.mv('path/to/file', 'path/to/dest'); 29 | ``` 30 | 31 | #### rm -rf 32 | 33 | Remove a file or folder recursively. Follows rules specified in [man rm](https://linux.die.net/man/1/rm) with the `-r` and `-f` rules specified. 34 | 35 | ```js 36 | const io = require('@actions/io'); 37 | 38 | await io.rmRF('path/to/directory'); 39 | await io.rmRF('path/to/file'); 40 | ``` 41 | 42 | #### which 43 | 44 | Get the path to a tool and resolves via paths. Follows the rules specified in [man which](https://linux.die.net/man/1/which). 45 | 46 | ```js 47 | const exec = require('@actions/exec'); 48 | const io = require('@actions/io'); 49 | 50 | const pythonPath: string = await io.which('python', true) 51 | 52 | await exec.exec(`"${pythonPath}"`, ['main.py']); 53 | ``` 54 | -------------------------------------------------------------------------------- /node_modules/@actions/io/lib/io-util.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import * as fs from 'fs'; 3 | export declare const chmod: typeof fs.promises.chmod, copyFile: typeof fs.promises.copyFile, lstat: typeof fs.promises.lstat, mkdir: typeof fs.promises.mkdir, readdir: typeof fs.promises.readdir, readlink: typeof fs.promises.readlink, rename: typeof fs.promises.rename, rmdir: typeof fs.promises.rmdir, stat: typeof fs.promises.stat, symlink: typeof fs.promises.symlink, unlink: typeof fs.promises.unlink; 4 | export declare const IS_WINDOWS: boolean; 5 | export declare function exists(fsPath: string): Promise; 6 | export declare function isDirectory(fsPath: string, useStat?: boolean): Promise; 7 | /** 8 | * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like: 9 | * \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases). 10 | */ 11 | export declare function isRooted(p: string): boolean; 12 | /** 13 | * Recursively create a directory at `fsPath`. 14 | * 15 | * This implementation is optimistic, meaning it attempts to create the full 16 | * path first, and backs up the path stack from there. 17 | * 18 | * @param fsPath The path to create 19 | * @param maxDepth The maximum recursion depth 20 | * @param depth The current recursion depth 21 | */ 22 | export declare function mkdirP(fsPath: string, maxDepth?: number, depth?: number): Promise; 23 | /** 24 | * Best effort attempt to determine whether a file exists and is executable. 25 | * @param filePath file path to check 26 | * @param extensions additional file extensions to try 27 | * @return if file exists and is executable, returns the file path. otherwise empty string. 28 | */ 29 | export declare function tryGetExecutablePath(filePath: string, extensions: string[]): Promise; 30 | -------------------------------------------------------------------------------- /node_modules/@actions/io/lib/io-util.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { 3 | function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } 4 | return new (P || (P = Promise))(function (resolve, reject) { 5 | function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } 6 | function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } 7 | function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } 8 | step((generator = generator.apply(thisArg, _arguments || [])).next()); 9 | }); 10 | }; 11 | var _a; 12 | Object.defineProperty(exports, "__esModule", { value: true }); 13 | const assert_1 = require("assert"); 14 | const fs = require("fs"); 15 | const path = require("path"); 16 | _a = fs.promises, exports.chmod = _a.chmod, exports.copyFile = _a.copyFile, exports.lstat = _a.lstat, exports.mkdir = _a.mkdir, exports.readdir = _a.readdir, exports.readlink = _a.readlink, exports.rename = _a.rename, exports.rmdir = _a.rmdir, exports.stat = _a.stat, exports.symlink = _a.symlink, exports.unlink = _a.unlink; 17 | exports.IS_WINDOWS = process.platform === 'win32'; 18 | function exists(fsPath) { 19 | return __awaiter(this, void 0, void 0, function* () { 20 | try { 21 | yield exports.stat(fsPath); 22 | } 23 | catch (err) { 24 | if (err.code === 'ENOENT') { 25 | return false; 26 | } 27 | throw err; 28 | } 29 | return true; 30 | }); 31 | } 32 | exports.exists = exists; 33 | function isDirectory(fsPath, useStat = false) { 34 | return __awaiter(this, void 0, void 0, function* () { 35 | const stats = useStat ? yield exports.stat(fsPath) : yield exports.lstat(fsPath); 36 | return stats.isDirectory(); 37 | }); 38 | } 39 | exports.isDirectory = isDirectory; 40 | /** 41 | * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like: 42 | * \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases). 43 | */ 44 | function isRooted(p) { 45 | p = normalizeSeparators(p); 46 | if (!p) { 47 | throw new Error('isRooted() parameter "p" cannot be empty'); 48 | } 49 | if (exports.IS_WINDOWS) { 50 | return (p.startsWith('\\') || /^[A-Z]:/i.test(p) // e.g. \ or \hello or \\hello 51 | ); // e.g. C: or C:\hello 52 | } 53 | return p.startsWith('/'); 54 | } 55 | exports.isRooted = isRooted; 56 | /** 57 | * Recursively create a directory at `fsPath`. 58 | * 59 | * This implementation is optimistic, meaning it attempts to create the full 60 | * path first, and backs up the path stack from there. 61 | * 62 | * @param fsPath The path to create 63 | * @param maxDepth The maximum recursion depth 64 | * @param depth The current recursion depth 65 | */ 66 | function mkdirP(fsPath, maxDepth = 1000, depth = 1) { 67 | return __awaiter(this, void 0, void 0, function* () { 68 | assert_1.ok(fsPath, 'a path argument must be provided'); 69 | fsPath = path.resolve(fsPath); 70 | if (depth >= maxDepth) 71 | return exports.mkdir(fsPath); 72 | try { 73 | yield exports.mkdir(fsPath); 74 | return; 75 | } 76 | catch (err) { 77 | switch (err.code) { 78 | case 'ENOENT': { 79 | yield mkdirP(path.dirname(fsPath), maxDepth, depth + 1); 80 | yield exports.mkdir(fsPath); 81 | return; 82 | } 83 | default: { 84 | let stats; 85 | try { 86 | stats = yield exports.stat(fsPath); 87 | } 88 | catch (err2) { 89 | throw err; 90 | } 91 | if (!stats.isDirectory()) 92 | throw err; 93 | } 94 | } 95 | } 96 | }); 97 | } 98 | exports.mkdirP = mkdirP; 99 | /** 100 | * Best effort attempt to determine whether a file exists and is executable. 101 | * @param filePath file path to check 102 | * @param extensions additional file extensions to try 103 | * @return if file exists and is executable, returns the file path. otherwise empty string. 104 | */ 105 | function tryGetExecutablePath(filePath, extensions) { 106 | return __awaiter(this, void 0, void 0, function* () { 107 | let stats = undefined; 108 | try { 109 | // test file exists 110 | stats = yield exports.stat(filePath); 111 | } 112 | catch (err) { 113 | if (err.code !== 'ENOENT') { 114 | // eslint-disable-next-line no-console 115 | console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`); 116 | } 117 | } 118 | if (stats && stats.isFile()) { 119 | if (exports.IS_WINDOWS) { 120 | // on Windows, test for valid extension 121 | const upperExt = path.extname(filePath).toUpperCase(); 122 | if (extensions.some(validExt => validExt.toUpperCase() === upperExt)) { 123 | return filePath; 124 | } 125 | } 126 | else { 127 | if (isUnixExecutable(stats)) { 128 | return filePath; 129 | } 130 | } 131 | } 132 | // try each extension 133 | const originalFilePath = filePath; 134 | for (const extension of extensions) { 135 | filePath = originalFilePath + extension; 136 | stats = undefined; 137 | try { 138 | stats = yield exports.stat(filePath); 139 | } 140 | catch (err) { 141 | if (err.code !== 'ENOENT') { 142 | // eslint-disable-next-line no-console 143 | console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`); 144 | } 145 | } 146 | if (stats && stats.isFile()) { 147 | if (exports.IS_WINDOWS) { 148 | // preserve the case of the actual file (since an extension was appended) 149 | try { 150 | const directory = path.dirname(filePath); 151 | const upperName = path.basename(filePath).toUpperCase(); 152 | for (const actualName of yield exports.readdir(directory)) { 153 | if (upperName === actualName.toUpperCase()) { 154 | filePath = path.join(directory, actualName); 155 | break; 156 | } 157 | } 158 | } 159 | catch (err) { 160 | // eslint-disable-next-line no-console 161 | console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`); 162 | } 163 | return filePath; 164 | } 165 | else { 166 | if (isUnixExecutable(stats)) { 167 | return filePath; 168 | } 169 | } 170 | } 171 | } 172 | return ''; 173 | }); 174 | } 175 | exports.tryGetExecutablePath = tryGetExecutablePath; 176 | function normalizeSeparators(p) { 177 | p = p || ''; 178 | if (exports.IS_WINDOWS) { 179 | // convert slashes on Windows 180 | p = p.replace(/\//g, '\\'); 181 | // remove redundant slashes 182 | return p.replace(/\\\\+/g, '\\'); 183 | } 184 | // remove redundant slashes 185 | return p.replace(/\/\/+/g, '/'); 186 | } 187 | // on Mac/Linux, test the execute bit 188 | // R W X R W X R W X 189 | // 256 128 64 32 16 8 4 2 1 190 | function isUnixExecutable(stats) { 191 | return ((stats.mode & 1) > 0 || 192 | ((stats.mode & 8) > 0 && stats.gid === process.getgid()) || 193 | ((stats.mode & 64) > 0 && stats.uid === process.getuid())); 194 | } 195 | //# sourceMappingURL=io-util.js.map -------------------------------------------------------------------------------- /node_modules/@actions/io/lib/io-util.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"io-util.js","sourceRoot":"","sources":["../src/io-util.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mCAAyB;AACzB,yBAAwB;AACxB,6BAA4B;AAEf,gBAYE,qTAAA;AAEF,QAAA,UAAU,GAAG,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAA;AAEtD,SAAsB,MAAM,CAAC,MAAc;;QACzC,IAAI;YACF,MAAM,YAAI,CAAC,MAAM,CAAC,CAAA;SACnB;QAAC,OAAO,GAAG,EAAE;YACZ,IAAI,GAAG,CAAC,IAAI,KAAK,QAAQ,EAAE;gBACzB,OAAO,KAAK,CAAA;aACb;YAED,MAAM,GAAG,CAAA;SACV;QAED,OAAO,IAAI,CAAA;IACb,CAAC;CAAA;AAZD,wBAYC;AAED,SAAsB,WAAW,CAC/B,MAAc,EACd,UAAmB,KAAK;;QAExB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G,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;QAE1B,2BAA2B;QAC3B,OAAO,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAA;KACjC;IAED,2BAA2B;IAC3B,OAAO,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAA;AACjC,CAAC;AAED,qCAAqC;AACrC,6BAA6B;AAC7B,6BAA6B;AAC7B,SAAS,gBAAgB,CAAC,KAAe;IACvC,OAAO,CACL,CAAC,KAAK,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,CAAC;QACpB,CAAC,CAAC,KAAK,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,GAAG,KAAK,OAAO,CAAC,MAAM,EAAE,CAAC;QACxD,CAAC,CAAC,KAAK,CAAC,IAAI,GAAG,EAAE,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,GAAG,KAAK,OAAO,CAAC,MAAM,EAAE,CAAC,CAC1D,CAAA;AACH,CAAC"} -------------------------------------------------------------------------------- /node_modules/@actions/io/lib/io.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Interface for cp/mv options 3 | */ 4 | export interface CopyOptions { 5 | /** Optional. Whether to recursively copy all subdirectories. Defaults to false */ 6 | recursive?: boolean; 7 | /** Optional. Whether to overwrite existing files in the destination. Defaults to true */ 8 | force?: boolean; 9 | } 10 | /** 11 | * Interface for cp/mv options 12 | */ 13 | export interface MoveOptions { 14 | /** Optional. Whether to overwrite existing files in the destination. Defaults to true */ 15 | force?: boolean; 16 | } 17 | /** 18 | * Copies a file or folder. 19 | * Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js 20 | * 21 | * @param source source path 22 | * @param dest destination path 23 | * @param options optional. See CopyOptions. 24 | */ 25 | export declare function cp(source: string, dest: string, options?: CopyOptions): Promise; 26 | /** 27 | * Moves a path. 28 | * 29 | * @param source source path 30 | * @param dest destination path 31 | * @param options optional. See MoveOptions. 32 | */ 33 | export declare function mv(source: string, dest: string, options?: MoveOptions): Promise; 34 | /** 35 | * Remove a path recursively with force 36 | * 37 | * @param inputPath path to remove 38 | */ 39 | export declare function rmRF(inputPath: string): Promise; 40 | /** 41 | * Make a directory. Creates the full path with folders in between 42 | * Will throw if it fails 43 | * 44 | * @param fsPath path to create 45 | * @returns Promise 46 | */ 47 | export declare function mkdirP(fsPath: string): Promise; 48 | /** 49 | * Returns path of a tool had the tool actually been invoked. Resolves via paths. 50 | * If you check and the tool does not exist, it will throw. 51 | * 52 | * @param tool name of the tool 53 | * @param check whether to check if tool exists 54 | * @returns Promise path to tool 55 | */ 56 | export declare function which(tool: string, check?: boolean): Promise; 57 | -------------------------------------------------------------------------------- /node_modules/@actions/io/lib/io.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { 3 | function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } 4 | return new (P || (P = Promise))(function (resolve, reject) { 5 | function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } 6 | function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } 7 | function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } 8 | step((generator = generator.apply(thisArg, _arguments || [])).next()); 9 | }); 10 | }; 11 | Object.defineProperty(exports, "__esModule", { value: true }); 12 | const childProcess = require("child_process"); 13 | const path = require("path"); 14 | const util_1 = require("util"); 15 | const ioUtil = require("./io-util"); 16 | const exec = util_1.promisify(childProcess.exec); 17 | /** 18 | * Copies a file or folder. 19 | * Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js 20 | * 21 | * @param source source path 22 | * @param dest destination path 23 | * @param options optional. See CopyOptions. 24 | */ 25 | function cp(source, dest, options = {}) { 26 | return __awaiter(this, void 0, void 0, function* () { 27 | const { force, recursive } = readCopyOptions(options); 28 | const destStat = (yield ioUtil.exists(dest)) ? yield ioUtil.stat(dest) : null; 29 | // Dest is an existing file, but not forcing 30 | if (destStat && destStat.isFile() && !force) { 31 | return; 32 | } 33 | // If dest is an existing directory, should copy inside. 34 | const newDest = destStat && destStat.isDirectory() 35 | ? path.join(dest, path.basename(source)) 36 | : dest; 37 | if (!(yield ioUtil.exists(source))) { 38 | throw new Error(`no such file or directory: ${source}`); 39 | } 40 | const sourceStat = yield ioUtil.stat(source); 41 | if (sourceStat.isDirectory()) { 42 | if (!recursive) { 43 | throw new Error(`Failed to copy. ${source} is a directory, but tried to copy without recursive flag.`); 44 | } 45 | else { 46 | yield cpDirRecursive(source, newDest, 0, force); 47 | } 48 | } 49 | else { 50 | if (path.relative(source, newDest) === '') { 51 | // a file cannot be copied to itself 52 | throw new Error(`'${newDest}' and '${source}' are the same file`); 53 | } 54 | yield copyFile(source, newDest, force); 55 | } 56 | }); 57 | } 58 | exports.cp = cp; 59 | /** 60 | * Moves a path. 61 | * 62 | * @param source source path 63 | * @param dest destination path 64 | * @param options optional. See MoveOptions. 65 | */ 66 | function mv(source, dest, options = {}) { 67 | return __awaiter(this, void 0, void 0, function* () { 68 | if (yield ioUtil.exists(dest)) { 69 | let destExists = true; 70 | if (yield ioUtil.isDirectory(dest)) { 71 | // If dest is directory copy src into dest 72 | dest = path.join(dest, path.basename(source)); 73 | destExists = yield ioUtil.exists(dest); 74 | } 75 | if (destExists) { 76 | if (options.force == null || options.force) { 77 | yield rmRF(dest); 78 | } 79 | else { 80 | throw new Error('Destination already exists'); 81 | } 82 | } 83 | } 84 | yield mkdirP(path.dirname(dest)); 85 | yield ioUtil.rename(source, dest); 86 | }); 87 | } 88 | exports.mv = mv; 89 | /** 90 | * Remove a path recursively with force 91 | * 92 | * @param inputPath path to remove 93 | */ 94 | function rmRF(inputPath) { 95 | return __awaiter(this, void 0, void 0, function* () { 96 | if (ioUtil.IS_WINDOWS) { 97 | // Node doesn't provide a delete operation, only an unlink function. This means that if the file is being used by another 98 | // program (e.g. antivirus), it won't be deleted. To address this, we shell out the work to rd/del. 99 | try { 100 | if (yield ioUtil.isDirectory(inputPath, true)) { 101 | yield exec(`rd /s /q "${inputPath}"`); 102 | } 103 | else { 104 | yield exec(`del /f /a "${inputPath}"`); 105 | } 106 | } 107 | catch (err) { 108 | // if you try to delete a file that doesn't exist, desired result is achieved 109 | // other errors are valid 110 | if (err.code !== 'ENOENT') 111 | throw err; 112 | } 113 | // Shelling out fails to remove a symlink folder with missing source, this unlink catches that 114 | try { 115 | yield ioUtil.unlink(inputPath); 116 | } 117 | catch (err) { 118 | // if you try to delete a file that doesn't exist, desired result is achieved 119 | // other errors are valid 120 | if (err.code !== 'ENOENT') 121 | throw err; 122 | } 123 | } 124 | else { 125 | let isDir = false; 126 | try { 127 | isDir = yield ioUtil.isDirectory(inputPath); 128 | } 129 | catch (err) { 130 | // if you try to delete a file that doesn't exist, desired result is achieved 131 | // other errors are valid 132 | if (err.code !== 'ENOENT') 133 | throw err; 134 | return; 135 | } 136 | if (isDir) { 137 | yield exec(`rm -rf "${inputPath}"`); 138 | } 139 | else { 140 | yield ioUtil.unlink(inputPath); 141 | } 142 | } 143 | }); 144 | } 145 | exports.rmRF = rmRF; 146 | /** 147 | * Make a directory. Creates the full path with folders in between 148 | * Will throw if it fails 149 | * 150 | * @param fsPath path to create 151 | * @returns Promise 152 | */ 153 | function mkdirP(fsPath) { 154 | return __awaiter(this, void 0, void 0, function* () { 155 | yield ioUtil.mkdirP(fsPath); 156 | }); 157 | } 158 | exports.mkdirP = mkdirP; 159 | /** 160 | * Returns path of a tool had the tool actually been invoked. Resolves via paths. 161 | * If you check and the tool does not exist, it will throw. 162 | * 163 | * @param tool name of the tool 164 | * @param check whether to check if tool exists 165 | * @returns Promise path to tool 166 | */ 167 | function which(tool, check) { 168 | return __awaiter(this, void 0, void 0, function* () { 169 | if (!tool) { 170 | throw new Error("parameter 'tool' is required"); 171 | } 172 | // recursive when check=true 173 | if (check) { 174 | const result = yield which(tool, false); 175 | if (!result) { 176 | if (ioUtil.IS_WINDOWS) { 177 | throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`); 178 | } 179 | else { 180 | throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`); 181 | } 182 | } 183 | } 184 | try { 185 | // build the list of extensions to try 186 | const extensions = []; 187 | if (ioUtil.IS_WINDOWS && process.env.PATHEXT) { 188 | for (const extension of process.env.PATHEXT.split(path.delimiter)) { 189 | if (extension) { 190 | extensions.push(extension); 191 | } 192 | } 193 | } 194 | // if it's rooted, return it if exists. otherwise return empty. 195 | if (ioUtil.isRooted(tool)) { 196 | const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions); 197 | if (filePath) { 198 | return filePath; 199 | } 200 | return ''; 201 | } 202 | // if any path separators, return empty 203 | if (tool.includes('/') || (ioUtil.IS_WINDOWS && tool.includes('\\'))) { 204 | return ''; 205 | } 206 | // build the list of directories 207 | // 208 | // Note, technically "where" checks the current directory on Windows. From a toolkit perspective, 209 | // it feels like we should not do this. Checking the current directory seems like more of a use 210 | // case of a shell, and the which() function exposed by the toolkit should strive for consistency 211 | // across platforms. 212 | const directories = []; 213 | if (process.env.PATH) { 214 | for (const p of process.env.PATH.split(path.delimiter)) { 215 | if (p) { 216 | directories.push(p); 217 | } 218 | } 219 | } 220 | // return the first match 221 | for (const directory of directories) { 222 | const filePath = yield ioUtil.tryGetExecutablePath(directory + path.sep + tool, extensions); 223 | if (filePath) { 224 | return filePath; 225 | } 226 | } 227 | return ''; 228 | } 229 | catch (err) { 230 | throw new Error(`which failed with message ${err.message}`); 231 | } 232 | }); 233 | } 234 | exports.which = which; 235 | function readCopyOptions(options) { 236 | const force = options.force == null ? true : options.force; 237 | const recursive = Boolean(options.recursive); 238 | return { force, recursive }; 239 | } 240 | function cpDirRecursive(sourceDir, destDir, currentDepth, force) { 241 | return __awaiter(this, void 0, void 0, function* () { 242 | // Ensure there is not a run away recursive copy 243 | if (currentDepth >= 255) 244 | return; 245 | currentDepth++; 246 | yield mkdirP(destDir); 247 | const files = yield ioUtil.readdir(sourceDir); 248 | for (const fileName of files) { 249 | const srcFile = `${sourceDir}/${fileName}`; 250 | const destFile = `${destDir}/${fileName}`; 251 | const srcFileStat = yield ioUtil.lstat(srcFile); 252 | if (srcFileStat.isDirectory()) { 253 | // Recurse 254 | yield cpDirRecursive(srcFile, destFile, currentDepth, force); 255 | } 256 | else { 257 | yield copyFile(srcFile, destFile, force); 258 | } 259 | } 260 | // Change the mode for the newly created directory 261 | yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode); 262 | }); 263 | } 264 | // Buffered file copy 265 | function copyFile(srcFile, destFile, force) { 266 | return __awaiter(this, void 0, void 0, function* () { 267 | if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) { 268 | // unlink/re-link it 269 | try { 270 | yield ioUtil.lstat(destFile); 271 | yield ioUtil.unlink(destFile); 272 | } 273 | catch (e) { 274 | // Try to override file permission 275 | if (e.code === 'EPERM') { 276 | yield ioUtil.chmod(destFile, '0666'); 277 | yield ioUtil.unlink(destFile); 278 | } 279 | // other errors = it doesn't exist, no work to do 280 | } 281 | // Copy over symlink 282 | const symlinkFull = yield ioUtil.readlink(srcFile); 283 | yield ioUtil.symlink(symlinkFull, destFile, ioUtil.IS_WINDOWS ? 'junction' : null); 284 | } 285 | else if (!(yield ioUtil.exists(destFile)) || force) { 286 | yield ioUtil.copyFile(srcFile, destFile); 287 | } 288 | }); 289 | } 290 | //# sourceMappingURL=io.js.map -------------------------------------------------------------------------------- /node_modules/@actions/io/lib/io.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"io.js","sourceRoot":"","sources":["../src/io.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,8CA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AM,WAAW,GAAW,MAAM,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAA;YAC1D,MAAM,MAAM,CAAC,OAAO,CAClB,WAAW,EACX,QAAQ,EACR,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CACtC,CAAA;SACF;aAAM,IAAI,CAAC,CAAC,MAAM,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,IAAI,KAAK,EAAE;YACpD,MAAM,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAA;SACzC;IACH,CAAC;CAAA"} -------------------------------------------------------------------------------- /node_modules/@actions/io/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_from": "@actions/io@^1.0.1", 3 | "_id": "@actions/io@1.0.2", 4 | "_inBundle": false, 5 | "_integrity": "sha512-J8KuFqVPr3p6U8W93DOXlXW6zFvrQAJANdS+vw0YhusLIq+bszW8zmK2Fh1C2kDPX8FMvwIl1OUcFgvJoXLbAg==", 6 | "_location": "/@actions/io", 7 | "_phantomChildren": {}, 8 | "_requested": { 9 | "type": "range", 10 | "registry": true, 11 | "raw": "@actions/io@^1.0.1", 12 | "name": "@actions/io", 13 | "escapedName": "@actions%2fio", 14 | "scope": "@actions", 15 | "rawSpec": "^1.0.1", 16 | "saveSpec": null, 17 | "fetchSpec": "^1.0.1" 18 | }, 19 | "_requiredBy": [ 20 | "/@actions/exec" 21 | ], 22 | "_resolved": "https://registry.npmjs.org/@actions/io/-/io-1.0.2.tgz", 23 | "_shasum": "2f614b6e69ce14d191180451eb38e6576a6e6b27", 24 | "_spec": "@actions/io@^1.0.1", 25 | "_where": "/Users/cday/Code/setup-dhall/node_modules/@actions/exec", 26 | "bugs": { 27 | "url": "https://github.com/actions/toolkit/issues" 28 | }, 29 | "bundleDependencies": false, 30 | "deprecated": false, 31 | "description": "Actions io lib", 32 | "directories": { 33 | "lib": "lib", 34 | "test": "__tests__" 35 | }, 36 | "files": [ 37 | "lib" 38 | ], 39 | "homepage": "https://github.com/actions/toolkit/tree/master/packages/io", 40 | "keywords": [ 41 | "github", 42 | "actions", 43 | "io" 44 | ], 45 | "license": "MIT", 46 | "main": "lib/io.js", 47 | "name": "@actions/io", 48 | "publishConfig": { 49 | "access": "public" 50 | }, 51 | "repository": { 52 | "type": "git", 53 | "url": "git+https://github.com/actions/toolkit.git", 54 | "directory": "packages/io" 55 | }, 56 | "scripts": { 57 | "audit-moderate": "npm install && npm audit --audit-level=moderate", 58 | "test": "echo \"Error: run tests from root\" && exit 1", 59 | "tsc": "tsc" 60 | }, 61 | "types": "lib/io.d.ts", 62 | "version": "1.0.2" 63 | } 64 | -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "setup-dhall", 3 | "version": "0.0.0", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "@actions/core": { 8 | "version": "1.9.1", 9 | "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.9.1.tgz", 10 | "integrity": "sha512-5ad+U2YGrmmiw6du20AQW5XuWo7UKN2052FjSV7MX+Wfjf8sCqcsZe62NfgHys4QI4/Y+vQvLKYL8jWtA1ZBTA==", 11 | "requires": { 12 | "@actions/http-client": "^2.0.1", 13 | "uuid": "^8.3.2" 14 | } 15 | }, 16 | "@actions/exec": { 17 | "version": "1.0.3", 18 | "resolved": "https://registry.npmjs.org/@actions/exec/-/exec-1.0.3.tgz", 19 | "integrity": "sha512-TogJGnueOmM7ntCi0ASTUj4LapRRtDfj57Ja4IhPmg2fls28uVOPbAn8N+JifaOumN2UG3oEO/Ixek2A4NcYSA==", 20 | "requires": { 21 | "@actions/io": "^1.0.1" 22 | } 23 | }, 24 | "@actions/http-client": { 25 | "version": "2.0.1", 26 | "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.0.1.tgz", 27 | "integrity": "sha512-PIXiMVtz6VvyaRsGY268qvj57hXQEpsYogYOu2nrQhlf+XCGmZstmuZBbAybUl1nQGnvS1k1eEsQ69ZoD7xlSw==", 28 | "requires": { 29 | "tunnel": "^0.0.6" 30 | } 31 | }, 32 | "@actions/io": { 33 | "version": "1.0.2", 34 | "resolved": "https://registry.npmjs.org/@actions/io/-/io-1.0.2.tgz", 35 | "integrity": "sha512-J8KuFqVPr3p6U8W93DOXlXW6zFvrQAJANdS+vw0YhusLIq+bszW8zmK2Fh1C2kDPX8FMvwIl1OUcFgvJoXLbAg==" 36 | }, 37 | "tunnel": { 38 | "version": "0.0.6", 39 | "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", 40 | "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==" 41 | }, 42 | "uuid": { 43 | "version": "8.3.2", 44 | "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", 45 | "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "setup-dhall", 3 | "version": "0.0.0", 4 | "description": "Github action to install a specific version of https://dhall-lang.org and run commands", 5 | "main": "action.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "git+https://github.com/craig-day/setup-dhall.git" 12 | }, 13 | "author": "Craig Day", 14 | "license": "MIT", 15 | "bugs": { 16 | "url": "https://github.com/craig-day/setup-dhall/issues" 17 | }, 18 | "homepage": "https://github.com/craig-day/setup-dhall#readme", 19 | "dependencies": { 20 | "@actions/core": "^1.9.1", 21 | "@actions/exec": "^1.0.3" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/action.js: -------------------------------------------------------------------------------- 1 | const core = require('@actions/core') 2 | const { exec } = require('@actions/exec') 3 | const path = require('path') 4 | const https = require('https') 5 | const os = require('os') 6 | 7 | const releasePatterns = () => { 8 | const platform = os.platform() 9 | let platformSuffix 10 | 11 | switch (platform) { 12 | case 'linux': 13 | platformSuffix = 'linux' 14 | break 15 | case 'darwin': 16 | platformSuffix = 'macos' 17 | break 18 | default: 19 | core.setFailed(`Unknown or unsuppored platform: ${platform}`) 20 | return 21 | } 22 | 23 | return { 24 | core: new RegExp(`dhall-[0-9.]+.*-${platformSuffix}\.tar\.bz2`, 'i'), 25 | json: new RegExp(`dhall-json-[0-9.]+.*-${platformSuffix}\.tar\.bz2`, 'i'), 26 | yaml: new RegExp(`dhall-yaml-[0-9.]+.*-${platformSuffix}\.tar\.bz2`, 'i'), 27 | } 28 | } 29 | 30 | const fetchReleases = async () => { 31 | const version = core.getInput('version') 32 | const versionPath = version == 'latest' ? 'latest' : `tags/${version}` 33 | const url = `https://api.github.com/repos/dhall-lang/dhall-haskell/releases/${versionPath}` 34 | 35 | core.info(`Fetching dhall releases from ${url}`) 36 | 37 | let release 38 | 39 | try { 40 | release = JSON.parse(await get(url)) 41 | } catch (error) { 42 | core.setFailed( 43 | `Failed to fetch releases from GitHub API, providing a token may help.\nError: ${error}` 44 | ) 45 | return 46 | } 47 | 48 | const patterns = releasePatterns() 49 | 50 | const coreRelease = release.assets.find(asset => 51 | patterns.core.test(asset.name) 52 | ) 53 | const jsonRelease = release.assets.find(asset => 54 | patterns.json.test(asset.name) 55 | ) 56 | const yamlRelease = release.assets.find(asset => 57 | patterns.yaml.test(asset.name) 58 | ) 59 | 60 | return { 61 | core: coreRelease.browser_download_url, 62 | json: jsonRelease.browser_download_url, 63 | yaml: yamlRelease.browser_download_url, 64 | } 65 | } 66 | 67 | const get = url => { 68 | return new Promise((resolve, reject) => { 69 | const headers = { 70 | 'User-Agent': 'setup-dhall Github action', 71 | } 72 | 73 | const token = core.getInput('github_token') 74 | 75 | if (token) { 76 | headers['Authorization'] = `token ${token}` 77 | } 78 | 79 | const request = https.get(url, { headers }) 80 | 81 | request.on('response', res => { 82 | let data = '' 83 | 84 | res.on('data', chunk => { 85 | data += chunk 86 | }) 87 | 88 | res.on('end', () => { 89 | if (res.statusCode == 200) { 90 | resolve(data) 91 | } else { 92 | reject(data) 93 | } 94 | }) 95 | }) 96 | 97 | request.on('error', err => { 98 | reject(err) 99 | }) 100 | }) 101 | } 102 | 103 | const run = async () => { 104 | const urls = await fetchReleases() 105 | 106 | await exec(path.join(__dirname, 'install-dhall.sh'), [urls.core, urls.json, urls.yaml]) 107 | } 108 | 109 | try { 110 | run() 111 | } catch (error) { 112 | core.setFailed(`Action failed with error: ${error}`) 113 | } 114 | -------------------------------------------------------------------------------- /src/install-dhall.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo "Downloading dhall from: $1" 4 | wget --quiet $1 5 | 6 | echo "Downloading dhall-json from: $2" 7 | wget --quiet $2 8 | 9 | echo "Downloading dhall-yaml from: $3" 10 | wget --quiet $3 11 | 12 | # Extract dhall-json and dhall-yaml first, makes final shell glob easier 13 | tar --extract --bzip2 --file dhall-json-*.tar.bz2 14 | rm -f dhall-json-*.tar.bz2 15 | 16 | tar --extract --bzip2 --file dhall-yaml-*.tar.bz2 17 | rm -f dhall-yaml-*.tar.bz2 18 | 19 | # Extract dhall now that dhall-json is done 20 | tar --extract --bzip2 --file dhall-*.tar.bz2 21 | rm -f dhall-*.tar.bz2 22 | 23 | # Add the dhall executables to the path for future actions 24 | echo "$(pwd)/bin" >> $GITHUB_PATH 25 | --------------------------------------------------------------------------------