Skip to content

Commit

Permalink
⚡️ feat: add cleanup job and refactor the code
Browse files Browse the repository at this point in the history
  • Loading branch information
ayungavis committed Oct 3, 2024
1 parent 2f5db8c commit e5a3245
Show file tree
Hide file tree
Showing 8 changed files with 368 additions and 156 deletions.
6 changes: 6 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ inputs:
description:
"Whether to reuse the existing preview environment if it's already created"
required: false
default: 'true'
cleanup:
description:
'Whether to cleanup the preview environment after the PR is closed'
required: false
default: 'false'

# Define your outputs here.
outputs:
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.
212 changes: 176 additions & 36 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.

17 changes: 17 additions & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
@@ -1 +1,18 @@
import * as core from '@actions/core'

export const RAILWAY_ENDPOINT = 'https://backboard.railway.app/graphql/v2'

// Action inputs
export const PROJECT_ID = core.getInput('project_id')
export const PROJECT_ENVIRONMENT_NAME = core.getInput('environment_name')
export const PROJECT_ENVIRONMENT_ID = core.getInput('environment_id')
export const PREVIEW_ENVIRONMENT_NAME = core.getInput(
'preview_environment_name'
)
export const ENVIRONMENT_VARIABLES = core.getInput('environment_variables')
export const API_SERVICE_NAME = core.getInput('api_service_name')
export const IGNORE_SERVICE_REDEPLOY = core.getInput('ignore_service_redeploy')
export const BRANCH_NAME = core.getInput('branch_name')
export const REUSE_PREVIEW_ENVIRONMENT =
core.getInput('reuse_preview_environment') || 'true'
export const IS_CLEANUP = core.getInput('cleanup') || 'false'
Loading

0 comments on commit e5a3245

Please sign in to comment.