Skip to content

Commit

Permalink
fix: handle input validation better
Browse files Browse the repository at this point in the history
  • Loading branch information
mscharley committed Nov 20, 2023
1 parent 5d4104f commit 5da5e6b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
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.
3 changes: 2 additions & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion src/io/parseInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { getBooleanInput, getInput, warning } from '@actions/core';
import { debugJson } from './debugJson';
import { getOctokit } from '@actions/github';

const USE_SEMANTIC_COMMITS = 'INPUT_USE-SEMANTIC-COMMITS';

export interface ActionInput {
author?: {
name: string;
Expand All @@ -24,7 +26,7 @@ const getAuthor = (): undefined | { name: string; email: string } => {
};

export const parseInput = (): ActionInput => {
const hasSemanticCommitConfig = 'INPUT_USE-SEMANTIC-COMMITS' in process.env;
const hasSemanticCommitConfig = process.env[USE_SEMANTIC_COMMITS] != null && process.env[USE_SEMANTIC_COMMITS] !== '';
if (hasSemanticCommitConfig) {
warning(
'The use-semantic-commits option was renamed to use-conventional-commits and will be removed at some point',
Expand Down

0 comments on commit 5da5e6b

Please sign in to comment.