Skip to content

Commit

Permalink
- Debugging and fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
miroslavpojer committed Jan 22, 2024
1 parent e9681cb commit c61db84
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 24 deletions.
18 changes: 6 additions & 12 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31287,25 +31287,19 @@ async function run() {
const repoOwner = github.context.repo.owner;
const repoName = github.context.repo.repo;
const githubToken = process.env.GITHUB_TOKEN;
const tagName = core.getInput('tag-name');

// Validate environment variables and arguments
if (!githubToken || !repoOwner || !repoName) {
if (!githubToken || !repoOwner || !repoName || !tagName) {
core.setFailed("Missing required inputs or environment variables.");
return;
}

const tagName = core.getInput('tag-name');
const chaptersJson = core.getInput('chapters');
if (core.getInput('warnings')) {
const warnings = core.getInput('warnings').toLowerCase() === 'true';
}
const chaptersJson = core.getInput('chapters') || "[]";
const warnings = core.getInput('warnings') ? core.getInput('warnings').toLowerCase() === 'true' : true;
const skipLabel = core.getInput('skip-release-notes-label') || 'skip-release-notes';
if (core.getInput('print-empty-chapters')) {
const printEmptyChapters = core.getInput('print-empty-chapters').toLowerCase() === 'true';
}
if (core.getInput('published-at')) {
const usePublishedAt = core.getInput('published-at').toLowerCase() === 'true';
}
const usePublishedAt = core.getInput('published-at') ? core.getInput('published-at').toLowerCase() === 'true' : false;
const printEmptyChapters = core.getInput('print-empty-chapters') ? core.getInput('print-empty-chapters').toLowerCase() === 'true' : true;

const octokit = new Octokit({ auth: githubToken });

Expand Down
18 changes: 6 additions & 12 deletions scripts/generate-release-notes.js
Original file line number Diff line number Diff line change
Expand Up @@ -384,25 +384,19 @@ async function run() {
const repoOwner = github.context.repo.owner;
const repoName = github.context.repo.repo;
const githubToken = process.env.GITHUB_TOKEN;
const tagName = core.getInput('tag-name');

// Validate environment variables and arguments
if (!githubToken || !repoOwner || !repoName) {
if (!githubToken || !repoOwner || !repoName || !tagName) {
core.setFailed("Missing required inputs or environment variables.");
return;
}

const tagName = core.getInput('tag-name');
const chaptersJson = core.getInput('chapters');
if (core.getInput('warnings')) {
const warnings = core.getInput('warnings').toLowerCase() === 'true';
}
const chaptersJson = core.getInput('chapters') || "[]";
const warnings = core.getInput('warnings') ? core.getInput('warnings').toLowerCase() === 'true' : true;
const skipLabel = core.getInput('skip-release-notes-label') || 'skip-release-notes';
if (core.getInput('print-empty-chapters')) {
const printEmptyChapters = core.getInput('print-empty-chapters').toLowerCase() === 'true';
}
if (core.getInput('published-at')) {
const usePublishedAt = core.getInput('published-at').toLowerCase() === 'true';
}
const usePublishedAt = core.getInput('published-at') ? core.getInput('published-at').toLowerCase() === 'true' : false;
const printEmptyChapters = core.getInput('print-empty-chapters') ? core.getInput('print-empty-chapters').toLowerCase() === 'true' : true;

const octokit = new Octokit({ auth: githubToken });

Expand Down

0 comments on commit c61db84

Please sign in to comment.