Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
dsarfati committed Apr 16, 2024
1 parent 073f0e2 commit 2a42c95
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 73 deletions.
84 changes: 42 additions & 42 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,57 +26,57 @@ inputs:
required: true

image_name:
description: 'The name of the container, including the registry to deploy'
description: 'The name of the container, including the registry and the tag'
required: true

# ghcr
github_token:
description:
'Personal Access Token (PAT) used to authenticate with the GitHub
Container Registry.'
required: false
# # ghcr
# github_token:
# description:
# 'Personal Access Token (PAT) used to authenticate with the GitHub
# Container Registry.'
# required: false

# basic auth
basic_username:
description:
'The username for basic auth - to be used in conjunction with
`basic_password`'
required: false
# # basic auth
# basic_username:
# description:
# 'The username for basic auth - to be used in conjunction with
# `basic_password`'
# required: false

basic_password:
description:
'The password for basic auth - to be used in conjunction with
`basic_username`'
required: false
# basic_password:
# description:
# 'The password for basic auth - to be used in conjunction with
# `basic_username`'
# required: false

# gcp gcr
service_key:
description:
'The username for basic auth - to be used in conjunction with
`basic_password`'
required: false
# # gcp gcr
# service_key:
# description:
# 'The username for basic auth - to be used in conjunction with
# `basic_password`'
# required: false

# ecr
aws_access_key_id:
description:
'AWS Access Key ID - to be used in conjunction with
`aws_secret_access_key`'
required: false
# # ecr
# aws_access_key_id:
# description:
# 'AWS Access Key ID - to be used in conjunction with
# `aws_secret_access_key`'
# required: false

aws_secret_access_key:
description:
'AWS Secret Access Key - to be used in conjunction with
`aws_access_key_id`'
required: false
# aws_secret_access_key:
# description:
# 'AWS Secret Access Key - to be used in conjunction with
# `aws_access_key_id`'
# required: false

# docker hub
dockerhub_username:
description: 'Docker Hub Username'
required: false
# # docker hub
# dockerhub_username:
# description: 'Docker Hub Username'
# required: false

dockerhub_password:
description: 'Docker Hub Personal Access Token'
required: false
# dockerhub_password:
# description: 'Docker Hub Personal Access Token'
# required: false

runs:
using: node20
Expand Down
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.
16 changes: 3 additions & 13 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.

21 changes: 5 additions & 16 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,9 @@ export async function run(): Promise<void> {
const apiKey = core.getInput('salad_api_key')
const imageName = core.getInput('image_name')

core.warning(`Org: ${org}`)
core.warning(`Project: ${proj}`)
core.warning(`ContainerGroup: ${containerGroup}`)

core.warning(`Making request`)
// https.request()
core.info(
`Starting to deploy ${imageName} to ${org}/${proj}/${containerGroup}`
)

const response = await fetch(
`https://api.salad.com/api/public/organizations/${org}/projects/${proj}/containers/${containerGroup}`,
Expand All @@ -33,20 +30,12 @@ export async function run(): Promise<void> {
}
)

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

if (!response.ok) {
core.setFailed('Unable to deploy updated container to Salad')
return
throw new Error('❌Unable to deploy updated container to Salad.❌')
}

const body = await response.json()

core.warning(body)
core.info('✅ The SCE Container Group was successfully updated!✅')
} catch (error) {
core.warning('Had an error')
core.error(JSON.stringify(error))
// Fail the workflow run if an error occurs
if (error instanceof Error) core.setFailed(error.message)
}
}

0 comments on commit 2a42c95

Please sign in to comment.