diff --git a/action.yml b/action.yml index 0c527c2..c1047e8 100644 --- a/action.yml +++ b/action.yml @@ -56,7 +56,7 @@ inputs: description: |- If true, the action will securely generate a credentials file which can be used for authentication via gcloud and Google Cloud SDKs. - default: true + default: 'true' required: false export_environment_variables: description: |- @@ -79,7 +79,7 @@ inputs: If false, the action will not export any environment variables, meaning future steps are unlikely to be automatically authenticated to Google Cloud. - default: true + default: 'true' required: false token_format: description: |- @@ -113,7 +113,7 @@ inputs: If true, the action will remove any created credentials from the filesystem upon completion. This only applies if "create_credentials_file" is true. - default: true + default: 'true' required: false # access token params @@ -175,7 +175,7 @@ inputs: generated token. If true, the token will contain "email" and "email_verified" claims. This is only valid when "token_format" is "id_token". - default: false + default: 'false' required: false outputs: diff --git a/src/main.ts b/src/main.ts index 5e84980..54822ea 100644 --- a/src/main.ts +++ b/src/main.ts @@ -16,7 +16,6 @@ import { join as pathjoin } from 'path'; import { exportVariable, - getBooleanInput, getIDToken, getInput, setFailed, @@ -29,6 +28,7 @@ import { isEmptyDir, isPinnedToHead, parseMultilineCSV, + parseBoolean, parseDuration, pinnedToHeadWarning, } from '@google-github-actions/actions-utils'; @@ -79,8 +79,8 @@ export async function run(logger: Logger) { const oidcTokenAudience = getInput(`audience`) || `https://iam.googleapis.com/${workloadIdentityProvider}`; const credentialsJSON = getInput(`credentials_json`); - const createCredentialsFile = getBooleanInput(`create_credentials_file`); - const exportEnvironmentVariables = getBooleanInput(`export_environment_variables`); + const createCredentialsFile = parseBoolean(getInput(`create_credentials_file`)); + const exportEnvironmentVariables = parseBoolean(getInput(`export_environment_variables`)); const tokenFormat = getInput(`token_format`); const delegates = parseMultilineCSV(getInput(`delegates`)); const universe = getInput(`universe`); @@ -301,7 +301,7 @@ export async function run(logger: Logger) { logger.debug(`Creating id token`); const idTokenAudience = getInput('id_token_audience', { required: true }); - const idTokenIncludeEmail = getBooleanInput('id_token_include_email'); + const idTokenIncludeEmail = parseBoolean(getInput('id_token_include_email')); // Ensure a service_account was provided if using WIF. if (!serviceAccount) { diff --git a/src/post.ts b/src/post.ts index 9773054..0d162a5 100644 --- a/src/post.ts +++ b/src/post.ts @@ -12,21 +12,21 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { getBooleanInput, setFailed } from '@actions/core'; +import { getInput, setFailed } from '@actions/core'; -import { errorMessage, forceRemove } from '@google-github-actions/actions-utils'; +import { errorMessage, forceRemove, parseBoolean } from '@google-github-actions/actions-utils'; import { Logger } from './logger'; export async function run(logger: Logger) { try { - const createCredentials = getBooleanInput('create_credentials_file'); + const createCredentials = parseBoolean(getInput('create_credentials_file')); if (!createCredentials) { logger.info(`Skipping credential cleanup - "create_credentials_file" is false.`); return; } - const cleanupCredentials = getBooleanInput('cleanup_credentials'); + const cleanupCredentials = parseBoolean(getInput('cleanup_credentials')); if (!cleanupCredentials) { logger.info(`Skipping credential cleanup - "cleanup_credentials" is false.`); return;