Skip to content

Commit

Permalink
Added patch
Browse files Browse the repository at this point in the history
  • Loading branch information
dsarfati committed Apr 16, 2024
1 parent 7ef9360 commit 4e73289
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 30 deletions.
2 changes: 1 addition & 1 deletion badges/coverage.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 7 additions & 12 deletions dist/index.js

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

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

23 changes: 7 additions & 16 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export async function run(): Promise<void> {
const proj = core.getInput('salad_project')
const containerGroup = core.getInput('salad_container_group')
const apiKey = core.getInput('salad_api_key')
const image = core.getInput('image_name')

core.warning(`Org: ${org}`)
core.warning(`Project: ${proj}`)
Expand All @@ -22,36 +23,26 @@ export async function run(): Promise<void> {
const response = await fetch(
`https://api.salad.com/api/public/organizations/${org}/projects/${proj}/containers/${containerGroup}`,
{
method: 'GET', // *GET, POST, PUT, DELETE, etc.
method: 'PATCH',
body: JSON.stringify({ container: image }),
headers: {
'Content-Type': 'application/json',
'Salad-Api-Key': apiKey
'Salad-Api-Key': apiKey,
'User-Agent': 'Salad SCE Deploy/0.1'
}
}
)

if (!response.ok) {
// TODO: Log issue
core.setFailed('Unable to deploy updated container to Salad')
return
}

core.warning(response.status.toString())

const body = await response.json()

core.warning(body)

// const ms: string = core.getInput('milliseconds')

// // Debug logs are only output if the `ACTIONS_STEP_DEBUG` secret is true
// core.debug(`Waiting ${ms} milliseconds ...`)

// // Log the current timestamp, wait, then log the new timestamp
// core.debug(new Date().toTimeString())
// await wait(parseInt(ms, 10))
// core.debug(new Date().toTimeString())

// // Set outputs for other workflow steps to use
// core.setOutput('time', new Date().toTimeString())
} catch (error) {
core.warning('Had an error')
core.error(JSON.stringify(error))
Expand Down

0 comments on commit 4e73289

Please sign in to comment.