Skip to content

Commit

Permalink
fix(output): set aws region as start mode output
Browse files Browse the repository at this point in the history
This is useful when caller workflow provides a profile for stop
mode and if associated PR tends to be merged before instance
teardown. In that case Slab will try to fetch the remote
configuration file (slab.toml) on a reference that has vanished
thus resulting in an error in Slab without terminating the
instance.
Using the region as input for stop mode avoid trying to fetch
slab.toml file.
  • Loading branch information
soonum committed Feb 20, 2024
1 parent f3a88ba commit 8562abb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ const config = require('./config')
const core = require('@actions/core')
const { waitForRunnerRegistered } = require('./gh')

function setOutput(label, ec2InstanceId) {
function setOutput(label, ec2InstanceId, region) {
core.setOutput('label', label)
core.setOutput('ec2-instance-id', ec2InstanceId)
core.setOutput('aws-region', region)
}

async function start() {
Expand All @@ -22,7 +23,8 @@ async function start() {

setOutput(
start_instance_response.runner_name,
wait_instance_response.instance_id
wait_instance_response.instance_id,
start_instance_response.aws_region
)

await waitForRunnerRegistered(start_instance_response.runner_name)
Expand Down

0 comments on commit 8562abb

Please sign in to comment.