├── LICENSE ├── README.md ├── action.yml ├── index.js ├── 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 ├── package-lock.json └── package.json /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Felipe Echanique Torres (felipe.echanique at gmail.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Salesforce SFDX CLI action 2 | 3 | This action allows to use the Salesforce SFDX CLI from GitHub Actions 4 | 5 | ## Inputs 6 | 7 | ### `sfdx-auth-url` 8 | 9 | **Optional** Authorize a Salesforce org using an SFDX auth URL 10 | 11 | The secret must have the format `force://@` or `force://::@` 12 | 13 | You can obtain the URL from a authorized org from your local machine using: `sfdx force:org:display -u ORG-ALIAS --verbose` 14 | 15 | ## Example usage 16 | 17 | ```yaml 18 | name: SFDX Test Run on Push 19 | 20 | on: [push] 21 | 22 | jobs: 23 | test: 24 | 25 | runs-on: ubuntu-latest 26 | 27 | steps: 28 | - uses: sfdx-actions/setup-sfdx@v1 29 | with: 30 | sfdx-auth-url: ${{ secrets.AUTH_SECRET }} 31 | - name: sfdx-test-run 32 | run: sfdx force:apex:test:run -l RunLocalTests -w 30 33 | ``` 34 | 35 | ## License 36 | ``` 37 | MIT License 38 | 39 | Copyright (c) 2019 Felipe Echanique Torres (felipe.echanique at gmail.com) 40 | 41 | Permission is hereby granted, free of charge, to any person obtaining a copy 42 | of this software and associated documentation files (the "Software"), to deal 43 | in the Software without restriction, including without limitation the rights 44 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 45 | copies of the Software, and to permit persons to whom the Software is 46 | furnished to do so, subject to the following conditions: 47 | 48 | The above copyright notice and this permission notice shall be included in all 49 | copies or substantial portions of the Software. 50 | 51 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 52 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 53 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 54 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 55 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 56 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 57 | SOFTWARE. 58 | ``` 59 | -------------------------------------------------------------------------------- /action.yml: -------------------------------------------------------------------------------- 1 | name: 'Salesforce SFDX CLI Action' 2 | author: Felipe Echanique Torres 3 | description: 'This action allows to use Salesforce SFDX CLI from GitHub Actions' 4 | inputs: 5 | sfdx-auth-url: 6 | description: Authorize a Salesforce org using an SFDX auth URL 7 | required: false 8 | runs: 9 | using: 'node16' 10 | main: 'index.js' 11 | branding: 12 | icon: 'terminal' 13 | color: 'purple' 14 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | const core = require('@actions/core') 2 | const exec = require('child_process').exec 3 | const fs = require('fs') 4 | 5 | try { 6 | installSFDX() 7 | } catch (error) { 8 | core.setFailed(error.message) 9 | } 10 | 11 | function installSFDX(){ 12 | var download = 'wget https://developer.salesforce.com/media/salesforce-cli/sfdx/channels/stable/sfdx-linux-x64.tar.xz -q -P /tmp' 13 | var createDir = 'mkdir /tmp/sfdx' 14 | var unzip = 'tar xJf /tmp/sfdx-linux-x64.tar.xz -C /tmp/sfdx --strip-components 1' 15 | var install = 'echo "/tmp/sfdx/bin" >> $GITHUB_PATH' 16 | var version = '/tmp/sfdx/bin/sfdx --version && /tmp/sfdx/bin/sfdx plugins --core' 17 | exec(download+' && '+createDir+' && '+unzip+' && '+install+' && '+version, function(error, stdout, stderr){ 18 | if(error) throw(stderr) 19 | core.info(stdout) 20 | if(core.getInput('sfdx-auth-url')) createAuthFile() 21 | }) 22 | } 23 | 24 | function createAuthFile(){ 25 | fs.writeFileSync('/tmp/sfdx_auth.txt', core.getInput('sfdx-auth-url')) 26 | authSFDX() 27 | } 28 | 29 | function authSFDX(){ 30 | var params = '--setdefaultdevhubusername --setdefaultusername -a SFDX-ENV' 31 | exec('/tmp/sfdx/bin/sfdx auth:sfdxurl:store -f /tmp/sfdx_auth.txt '+params, function(error, stdout, stderr){ 32 | if(error) throw(stderr) 33 | core.info(stdout) 34 | }) 35 | } 36 | 37 | -------------------------------------------------------------------------------- /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 | // Do stuff 86 | } 87 | catch (err) { 88 | core.error(`Error ${err}, action may still succeed though`); 89 | } 90 | ``` 91 | 92 | This library can also wrap chunks of output in foldable groups. 93 | 94 | ```js 95 | const core = require('@actions/core') 96 | 97 | // Manually wrap output 98 | core.startGroup('Do some function') 99 | doSomeFunction() 100 | core.endGroup() 101 | 102 | // Wrap an asynchronous function call 103 | const result = await core.group('Do something async', async () => { 104 | const response = await doSomeHTTPRequest() 105 | return response 106 | }) 107 | ``` 108 | 109 | #### Action state 110 | 111 | You can use this library to save state and get state for sharing information between a given wrapper action: 112 | 113 | **action.yml** 114 | ```yaml 115 | name: 'Wrapper action sample' 116 | inputs: 117 | name: 118 | default: 'GitHub' 119 | runs: 120 | using: 'node12' 121 | main: 'main.js' 122 | post: 'cleanup.js' 123 | ``` 124 | 125 | In action's `main.js`: 126 | 127 | ```js 128 | const core = require('@actions/core'); 129 | 130 | core.saveState("pidToKill", 12345); 131 | ``` 132 | 133 | In action's `cleanup.js`: 134 | ```js 135 | const core = require('@actions/core'); 136 | 137 | var pid = core.getState("pidToKill"); 138 | 139 | process.kill(pid); 140 | ``` -------------------------------------------------------------------------------- /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 user warning message 12 | * ##[set-secret name=mypassword]definitelyNotAPassword! 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 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | const os = require("os"); 4 | /** 5 | * Commands 6 | * 7 | * Command Format: 8 | * ##[name key=value;key=value]message 9 | * 10 | * Examples: 11 | * ##[warning]This is the user warning message 12 | * ##[set-secret name=mypassword]definitelyNotAPassword! 13 | */ 14 | function issueCommand(command, properties, message) { 15 | const cmd = new Command(command, properties, message); 16 | process.stdout.write(cmd.toString() + os.EOL); 17 | } 18 | exports.issueCommand = issueCommand; 19 | function issue(name, message = '') { 20 | issueCommand(name, {}, message); 21 | } 22 | exports.issue = issue; 23 | const CMD_STRING = '::'; 24 | class Command { 25 | constructor(command, properties, message) { 26 | if (!command) { 27 | command = 'missing.command'; 28 | } 29 | this.command = command; 30 | this.properties = properties; 31 | this.message = message; 32 | } 33 | toString() { 34 | let cmdStr = CMD_STRING + this.command; 35 | if (this.properties && Object.keys(this.properties).length > 0) { 36 | cmdStr += ' '; 37 | for (const key in this.properties) { 38 | if (this.properties.hasOwnProperty(key)) { 39 | const val = this.properties[key]; 40 | if (val) { 41 | // safely append the val - avoid blowing up when attempting to 42 | // call .replace() if message is not a string for some reason 43 | cmdStr += `${key}=${escape(`${val || ''}`)},`; 44 | } 45 | } 46 | } 47 | } 48 | cmdStr += CMD_STRING; 49 | // safely append the message - avoid blowing up when attempting to 50 | // call .replace() if message is not a string for some reason 51 | const message = `${this.message || ''}`; 52 | cmdStr += escapeData(message); 53 | return cmdStr; 54 | } 55 | } 56 | function escapeData(s) { 57 | return s.replace(/\r/g, '%0D').replace(/\n/g, '%0A'); 58 | } 59 | function escape(s) { 60 | return s 61 | .replace(/\r/g, '%0D') 62 | .replace(/\n/g, '%0A') 63 | .replace(/]/g, '%5D') 64 | .replace(/;/g, '%3B'); 65 | } 66 | //# 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,yBAAwB;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,UAA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AS;IAC3B,OAAO,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAA;AACtD,CAAC;AAED,SAAS,MAAM,CAAC,CAAS;IACvB,OAAO,CAAC;SACL,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 | * Writes debug message to user log 60 | * @param message debug message 61 | */ 62 | export declare function debug(message: string): void; 63 | /** 64 | * Adds an error issue 65 | * @param message error issue message 66 | */ 67 | export declare function error(message: string): void; 68 | /** 69 | * Adds an warning issue 70 | * @param message warning issue message 71 | */ 72 | export declare function warning(message: string): void; 73 | /** 74 | * Writes info to log with console.log. 75 | * @param message info message 76 | */ 77 | export declare function info(message: string): void; 78 | /** 79 | * Begin an output group. 80 | * 81 | * Output until the next `groupEnd` will be foldable in this group 82 | * 83 | * @param name The name of the output group 84 | */ 85 | export declare function startGroup(name: string): void; 86 | /** 87 | * End an output group. 88 | */ 89 | export declare function endGroup(): void; 90 | /** 91 | * Wrap an asynchronous function call in a group. 92 | * 93 | * Returns the same type as the function itself. 94 | * 95 | * @param name The name of the group 96 | * @param fn The function to wrap in the group 97 | */ 98 | export declare function group(name: string, fn: () => Promise): Promise; 99 | /** 100 | * Saves state for current action, the state can only be retrieved by this action's post job execution. 101 | * 102 | * @param name name of the state to store 103 | * @param value value to store 104 | */ 105 | export declare function saveState(name: string, value: string): void; 106 | /** 107 | * Gets the value of an state set by this action's main execution. 108 | * 109 | * @param name name of the state to get 110 | * @returns string 111 | */ 112 | export declare function getState(name: string): string; 113 | -------------------------------------------------------------------------------- /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 | Object.defineProperty(exports, "__esModule", { value: true }); 12 | const command_1 = require("./command"); 13 | const os = require("os"); 14 | const path = require("path"); 15 | /** 16 | * The code to exit an action 17 | */ 18 | var ExitCode; 19 | (function (ExitCode) { 20 | /** 21 | * A code indicating that the action was successful 22 | */ 23 | ExitCode[ExitCode["Success"] = 0] = "Success"; 24 | /** 25 | * A code indicating that the action was a failure 26 | */ 27 | ExitCode[ExitCode["Failure"] = 1] = "Failure"; 28 | })(ExitCode = exports.ExitCode || (exports.ExitCode = {})); 29 | //----------------------------------------------------------------------- 30 | // Variables 31 | //----------------------------------------------------------------------- 32 | /** 33 | * Sets env variable for this action and future actions in the job 34 | * @param name the name of the variable to set 35 | * @param val the value of the variable 36 | */ 37 | function exportVariable(name, val) { 38 | process.env[name] = val; 39 | command_1.issueCommand('set-env', { name }, val); 40 | } 41 | exports.exportVariable = exportVariable; 42 | /** 43 | * Registers a secret which will get masked from logs 44 | * @param secret value of the secret 45 | */ 46 | function setSecret(secret) { 47 | command_1.issueCommand('add-mask', {}, secret); 48 | } 49 | exports.setSecret = setSecret; 50 | /** 51 | * Prepends inputPath to the PATH (for this action and future actions) 52 | * @param inputPath 53 | */ 54 | function addPath(inputPath) { 55 | command_1.issueCommand('add-path', {}, inputPath); 56 | process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`; 57 | } 58 | exports.addPath = addPath; 59 | /** 60 | * Gets the value of an input. The value is also trimmed. 61 | * 62 | * @param name name of the input to get 63 | * @param options optional. See InputOptions. 64 | * @returns string 65 | */ 66 | function getInput(name, options) { 67 | const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || ''; 68 | if (options && options.required && !val) { 69 | throw new Error(`Input required and not supplied: ${name}`); 70 | } 71 | return val.trim(); 72 | } 73 | exports.getInput = getInput; 74 | /** 75 | * Sets the value of an output. 76 | * 77 | * @param name name of the output to set 78 | * @param value value to store 79 | */ 80 | function setOutput(name, value) { 81 | command_1.issueCommand('set-output', { name }, value); 82 | } 83 | exports.setOutput = setOutput; 84 | //----------------------------------------------------------------------- 85 | // Results 86 | //----------------------------------------------------------------------- 87 | /** 88 | * Sets the action status to failed. 89 | * When the action exits it will be with an exit code of 1 90 | * @param message add error issue message 91 | */ 92 | function setFailed(message) { 93 | process.exitCode = ExitCode.Failure; 94 | error(message); 95 | } 96 | exports.setFailed = setFailed; 97 | //----------------------------------------------------------------------- 98 | // Logging Commands 99 | //----------------------------------------------------------------------- 100 | /** 101 | * Writes debug message to user log 102 | * @param message debug message 103 | */ 104 | function debug(message) { 105 | command_1.issueCommand('debug', {}, message); 106 | } 107 | exports.debug = debug; 108 | /** 109 | * Adds an error issue 110 | * @param message error issue message 111 | */ 112 | function error(message) { 113 | command_1.issue('error', message); 114 | } 115 | exports.error = error; 116 | /** 117 | * Adds an warning issue 118 | * @param message warning issue message 119 | */ 120 | function warning(message) { 121 | command_1.issue('warning', message); 122 | } 123 | exports.warning = warning; 124 | /** 125 | * Writes info to log with console.log. 126 | * @param message info message 127 | */ 128 | function info(message) { 129 | process.stdout.write(message + os.EOL); 130 | } 131 | exports.info = info; 132 | /** 133 | * Begin an output group. 134 | * 135 | * Output until the next `groupEnd` will be foldable in this group 136 | * 137 | * @param name The name of the output group 138 | */ 139 | function startGroup(name) { 140 | command_1.issue('group', name); 141 | } 142 | exports.startGroup = startGroup; 143 | /** 144 | * End an output group. 145 | */ 146 | function endGroup() { 147 | command_1.issue('endgroup'); 148 | } 149 | exports.endGroup = endGroup; 150 | /** 151 | * Wrap an asynchronous function call in a group. 152 | * 153 | * Returns the same type as the function itself. 154 | * 155 | * @param name The name of the group 156 | * @param fn The function to wrap in the group 157 | */ 158 | function group(name, fn) { 159 | return __awaiter(this, void 0, void 0, function* () { 160 | startGroup(name); 161 | let result; 162 | try { 163 | result = yield fn(); 164 | } 165 | finally { 166 | endGroup(); 167 | } 168 | return result; 169 | }); 170 | } 171 | exports.group = group; 172 | //----------------------------------------------------------------------- 173 | // Wrapper action state 174 | //----------------------------------------------------------------------- 175 | /** 176 | * Saves state for current action, the state can only be retrieved by this action's post job execution. 177 | * 178 | * @param name name of the state to store 179 | * @param value value to store 180 | */ 181 | function saveState(name, value) { 182 | command_1.issueCommand('save-state', { name }, value); 183 | } 184 | exports.saveState = saveState; 185 | /** 186 | * Gets the value of an state set by this action's main execution. 187 | * 188 | * @param name name of the state to get 189 | * @returns string 190 | */ 191 | function getState(name) { 192 | return process.env[`STATE_${name}`] || ''; 193 | } 194 | exports.getState = getState; 195 | //# 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,yBAAwB;AACxB,6BAA4B;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,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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@^1.2.0", 3 | "_id": "@actions/core@1.2.0", 4 | "_inBundle": false, 5 | "_integrity": "sha512-ZKdyhlSlyz38S6YFfPnyNgCDZuAF2T0Qv5eHflNWytPS8Qjvz39bZFMry9Bb/dpSnqWcNeav5yM2CTYpJeY+Dw==", 6 | "_location": "/@actions/core", 7 | "_phantomChildren": {}, 8 | "_requested": { 9 | "type": "range", 10 | "registry": true, 11 | "raw": "@actions/core@^1.2.0", 12 | "name": "@actions/core", 13 | "escapedName": "@actions%2fcore", 14 | "scope": "@actions", 15 | "rawSpec": "^1.2.0", 16 | "saveSpec": null, 17 | "fetchSpec": "^1.2.0" 18 | }, 19 | "_requiredBy": [ 20 | "/" 21 | ], 22 | "_resolved": "https://registry.npmjs.org/@actions/core/-/core-1.2.0.tgz", 23 | "_shasum": "aa5f52b26c362c821d41557e599371a42f6c0b3d", 24 | "_spec": "@actions/core@^1.2.0", 25 | "_where": "C:\\Users\\Felipe\\Dropbox\\workspace\\cli", 26 | "bugs": { 27 | "url": "https://github.com/actions/toolkit/issues" 28 | }, 29 | "bundleDependencies": false, 30 | "deprecated": false, 31 | "description": "Actions core lib", 32 | "devDependencies": { 33 | "@types/node": "^12.0.2" 34 | }, 35 | "directories": { 36 | "lib": "lib", 37 | "test": "__tests__" 38 | }, 39 | "files": [ 40 | "lib" 41 | ], 42 | "homepage": "https://github.com/actions/toolkit/tree/master/packages/core", 43 | "keywords": [ 44 | "github", 45 | "actions", 46 | "core" 47 | ], 48 | "license": "MIT", 49 | "main": "lib/core.js", 50 | "name": "@actions/core", 51 | "publishConfig": { 52 | "access": "public" 53 | }, 54 | "repository": { 55 | "type": "git", 56 | "url": "git+https://github.com/actions/toolkit.git", 57 | "directory": "packages/core" 58 | }, 59 | "scripts": { 60 | "test": "echo \"Error: run tests from root\" && exit 1", 61 | "tsc": "tsc" 62 | }, 63 | "version": "1.2.0" 64 | } 65 | -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "setup-sfdx-action", 3 | "version": "1.0.0", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "@actions/core": { 8 | "version": "1.2.6", 9 | "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.2.6.tgz", 10 | "integrity": "sha512-ZQYitnqiyBc3D+k7LsgSBmMDVkOVidaagDG7j3fOym77jNunWRuYx7VSHa9GNfFZh+zh61xsCjRj4JxMZlDqTA==" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "setup-sfdx-action", 3 | "version": "1.0.0", 4 | "description": "This action allows to use the Salesforce SFDX CLI from GitHub Actions", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "git+https://github.com/sfdx-actions/setup-sfdx.git" 12 | }, 13 | "keywords": [], 14 | "author": "", 15 | "license": "ISC", 16 | "bugs": { 17 | "url": "https://github.com/sfdx-actions/setup-sfdx/issues" 18 | }, 19 | "homepage": "https://github.com/sfdx-actions/setup-sfdx#readme", 20 | "dependencies": { 21 | "@actions/core": "^1.2.6" 22 | } 23 | } 24 | --------------------------------------------------------------------------------