Skip to content

Commit

Permalink
Update SCE APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
dsarfati committed Apr 15, 2024
1 parent 7f4b35b commit 7e2cd55
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 30 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ jobs:
id: test-action
uses: ./
with:
milliseconds: 2000

- name: Print Output
id: output
run: echo "${{ steps.test-action.outputs.time }}"
salad-organization: salad
salad-project: development
salad-container-group: test-actions
3 changes: 0 additions & 3 deletions CODEOWNERS

This file was deleted.

29 changes: 17 additions & 12 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
name: 'The name of your action here'
description: 'Provide a description here'
author: 'Your name or organization here'
name: 'Salad Container Engine Action'
description: 'Automatically deploy new GHCR containers to your Salad Account.'
author: 'SaladTechnologies'

# Add your action's branding here. This will appear on the GitHub Marketplace.
branding:
icon: 'heart'
color: 'red'
icon: 'cloud-snow'
color: 'green'

# Define your inputs here.
inputs:
milliseconds:
description: 'Your input description here'
salad-organization:
description: 'Your Salad organization name.'
required: true
salad-project:
description: 'Your Salad project name.'
required: true
salad-container-group:
description: 'Your Salad container group name.'
required: true
default: '1000'

# Define your outputs here.
outputs:
time:
description: 'Your output description here'
# # Define your outputs here.
# outputs:
# time:
# description: 'Your output description here'

runs:
using: node20
Expand Down
27 changes: 17 additions & 10 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,31 @@
import * as core from '@actions/core'
import { wait } from './wait'

/**
* The main function for the action.
* @returns {Promise<void>} Resolves when the action is complete.
*/
export async function run(): Promise<void> {
try {
const ms: string = core.getInput('milliseconds')
core.warning('Starting action')
let org = core.getInput('salad-organization')

Check failure on line 10 in src/main.ts

View workflow job for this annotation

GitHub Actions / Lint Codebase

'org' is never reassigned. Use 'const' instead

Check failure on line 10 in src/main.ts

View workflow job for this annotation

GitHub Actions / TypeScript Tests

'org' is never reassigned. Use 'const' instead
let proj = core.getInput('salad-project')

Check failure on line 11 in src/main.ts

View workflow job for this annotation

GitHub Actions / Lint Codebase

'proj' is never reassigned. Use 'const' instead

Check failure on line 11 in src/main.ts

View workflow job for this annotation

GitHub Actions / TypeScript Tests

'proj' is never reassigned. Use 'const' instead
let containerGroup = core.getInput('salad-container-group')

Check failure on line 12 in src/main.ts

View workflow job for this annotation

GitHub Actions / Lint Codebase

'containerGroup' is never reassigned. Use 'const' instead

Check failure on line 12 in src/main.ts

View workflow job for this annotation

GitHub Actions / TypeScript Tests

'containerGroup' is never reassigned. Use 'const' instead

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

Check failure on line 14 in src/main.ts

View workflow job for this annotation

GitHub Actions / Lint Codebase

Unexpected string concatenation

Check failure on line 14 in src/main.ts

View workflow job for this annotation

GitHub Actions / TypeScript Tests

Unexpected string concatenation
core.warning('Project:' + proj)

Check failure on line 15 in src/main.ts

View workflow job for this annotation

GitHub Actions / Lint Codebase

Unexpected string concatenation

Check failure on line 15 in src/main.ts

View workflow job for this annotation

GitHub Actions / TypeScript Tests

Unexpected string concatenation
core.warning('ContainerGroup:' + containerGroup)

Check failure on line 16 in src/main.ts

View workflow job for this annotation

GitHub Actions / Lint Codebase

Unexpected string concatenation

Check failure on line 16 in src/main.ts

View workflow job for this annotation

GitHub Actions / TypeScript Tests

Unexpected string concatenation
// const ms: string = core.getInput('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())
// // Debug logs are only output if the `ACTIONS_STEP_DEBUG` secret is true
// core.debug(`Waiting ${ms} milliseconds ...`)

// Set outputs for other workflow steps to use
core.setOutput('time', new Date().toTimeString())
// // 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) {
// Fail the workflow run if an error occurs
if (error instanceof Error) core.setFailed(error.message)
Expand Down

0 comments on commit 7e2cd55

Please sign in to comment.