Skip to content

Commit

Permalink
Merge pull request #175 from github/code-cleanup
Browse files Browse the repository at this point in the history
Code cleanup
  • Loading branch information
GrantBirki authored Jul 28, 2023
2 parents 8bfe76a + 995686d commit 50e32ea
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 33 deletions.
58 changes: 30 additions & 28 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.

3 changes: 2 additions & 1 deletion src/functions/environment-targets.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as core from '@actions/core'
import dedent from 'dedent-js'
import {checkInput} from './check-input'
import {actionStatus} from './action-status'
import {LOCK_METADATA} from './lock-metadata'

Expand Down Expand Up @@ -270,7 +271,7 @@ async function findEnvironmentUrl(environment, environment_urls) {
// The structure: "<environment1>|<url1>,<environment2>|<url2>,etc"

// If the environment URLs are empty, just return an empty string
if (environment_urls === null || environment_urls.trim() === '') {
if ((await checkInput(environment_urls)) === null) {
return null
}

Expand Down
7 changes: 4 additions & 3 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ import {stringToArray} from './functions/string-to-array'
export async function run() {
try {
// Get the inputs for the branch-deploy Action
const trigger = core.getInput('trigger')
const reaction = core.getInput('reaction')
const token = core.getInput('github_token', {required: true})
var environment = core.getInput('environment', {required: true})
const trigger = core.getInput('trigger', {required: true})
const reaction = core.getInput('reaction')
const stable_branch = core.getInput('stable_branch')
const noop_trigger = core.getInput('noop_trigger')
const lock_trigger = core.getInput('lock_trigger')
Expand All @@ -49,6 +49,7 @@ export async function run() {
const admins = core.getInput('admins')
const environment_urls = core.getInput('environment_urls')
const param_separator = core.getInput('param_separator')
const permissions = core.getInput('permissions')

// Create an octokit client
const octokit = github.getOctokit(token)
Expand Down Expand Up @@ -177,7 +178,7 @@ export async function run() {
skipReviews: skipReviews,
draft_permitted_targets,
admins: admins,
permissions: await stringToArray(core.getInput('permissions'))
permissions: await stringToArray(permissions)
}

// Run the help command and exit
Expand Down

0 comments on commit 50e32ea

Please sign in to comment.