IssueRaiser

Validate required inputs are set before invoking an action

**Describe the bug** I have the following **action.yml**: ``` name: 'Anka Prepare VM and execute inside' description: 'Prepare an Anka VM and execute commands inside' author: Veertu branding: icon: 'anchor' color: 'blue' inputs: anka-template: description: 'name or UUID of Anka Template' required: true ``` My **index.js** looks like: ``` const core = require('@actions/core'); const io = require('@actions/io'); const prepare = require('./prepare'); const execute = require('./execute'); // most @actions toolkit packages have async methods async function run() { try { const ankaVirtCLIPath = await io.which('anka', true) console.log(`Anka Virtualization CLI found at: ${ankaVirtCLIPath}`) const ankaTemplate = core.getInput('anka-template'); const ankaTag = core.getInput('anka-tag'); const ankaCommands = core.getInput('commands'); const hostPreCommands = core.getInput('host-pre-commands'); const hostPostCommands = core.getInput('host-post-commands'); console.log("=========================" + "\n" + `${hostPreCommands}` + "\n" + "=================================") console.log("=========================" + "\n" + `${hostPostCommands}` + "\n" + "=================================") console.log("=========================" + "\n" + `${ankaCommands}` + "\n" + "=================================") if (hostPreCommands) { await execute.nodeCommands(hostPreCommands) } // Prepare VM await prepare.ankaRegistryPul

Posted by NorseGaud on Jun 1, 2020, 7:41 PM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.3,500 issues0 comments

github (Other)

Validate required inputs are set before invoking an action

NorseGaudJun 1, 2020, 7:41 PM

**Describe the bug** I have the following **action.yml**: ``` name: 'Anka Prepare VM and execute inside' description: 'Prepare an Anka VM and execute commands inside' author: Veertu branding: icon: 'anchor' color: 'blue' inputs: anka-template: description: 'name or UUID of Anka Template' required: true ``` My **index.js** looks like: ``` const core = require('@actions/core'); const io = require('@actions/io'); const prepare = require('./prepare'); const execute = require('./execute'); // most @actions toolkit packages have async methods async function run() { try { const ankaVirtCLIPath = await io.which('anka', true) console.log(`Anka Virtualization CLI found at: ${ankaVirtCLIPath}`) const ankaTemplate = core.getInput('anka-template'); const ankaTag = core.getInput('anka-tag'); const ankaCommands = core.getInput('commands'); const hostPreCommands = core.getInput('host-pre-commands'); const hostPostCommands = core.getInput('host-post-commands'); console.log("=========================" + "\n" + `${hostPreCommands}` + "\n" + "=================================") console.log("=========================" + "\n" + `${hostPostCommands}` + "\n" + "=================================") console.log("=========================" + "\n" + `${ankaCommands}` + "\n" + "=================================") if (hostPreCommands) { await execute.nodeCommands(hostPreCommands) } // Prepare VM await prepare.ankaRegistryPul

Comments (0)

No comments yet. Start the discussion.

Comment on this issue