Skip to content

Commit

Permalink
chore: Add an action to test
Browse files Browse the repository at this point in the history
  • Loading branch information
riosje committed May 23, 2024
1 parent 34cc9ec commit 810dbd2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -123586,19 +123586,19 @@ async function stop(InstanceIds) {
async function run() {
try {
const instances_id = JSON.parse(core.getInput('instances_id', {required: true}))
const action = (core.getInput('action', {required: true})).toLowerCase
const action = core.getInput('action', {required: true})

if (action === "start") {
if (action.toLowerCase() === "start") {
await start(instances_id);
return
}

if (action === "stop") {
if (action.toLowerCase() === "stop") {
await stop(instances_id);
return
}


core.setFailed("Invalid action. Please provide either 'start' or 'stop' as action")
} catch (err) {
core.setFailed(err);
}
Expand Down
8 changes: 4 additions & 4 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ import { start, stop } from "./lib/ec2Handler.js";
async function run() {
try {
const instances_id = JSON.parse(core.getInput('instances_id', {required: true}))
const action = (core.getInput('action', {required: true})).toLowerCase
const action = core.getInput('action', {required: true})

if (action === "start") {
if (action.toLowerCase() === "start") {
await start(instances_id);
return
}

if (action === "stop") {
if (action.toLowerCase() === "stop") {
await stop(instances_id);
return
}


core.setFailed("Invalid action. Please provide either 'start' or 'stop' as action")
} catch (err) {
core.setFailed(err);
}
Expand Down

0 comments on commit 810dbd2

Please sign in to comment.