From 7d928fcc8a3934c8bf8ca6a465f2aa0b5365133a Mon Sep 17 00:00:00 2001 From: Rasmus Saks Date: Fri, 23 Feb 2024 16:03:39 +0200 Subject: [PATCH] Define path input variable, update Node to 20 --- CHANGELOG.md | 7 +++++++ action.yml | 6 +++++- index.js | 3 +-- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index da1874a..9a27591 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,13 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +## [v1.1.1] - 2024-02-23 + +### Fixed + +* Fixed the `path` input not actually being defined in `action.yml` +* Moved from deprecated Node 12 to Node 20 + ## [v1.1.0] - 2024-02-08 ### Added diff --git a/action.yml b/action.yml index 7ded8f5..64ab6cf 100644 --- a/action.yml +++ b/action.yml @@ -2,7 +2,7 @@ name: 'Release a Changelog' description: 'Creates a GitHub release based on Keep a Changelog' runs: - using: node12 + using: node20 main: 'index.js' branding: @@ -13,3 +13,7 @@ inputs: github-token: description: "GitHub token" required: true + path: + description: "Path to the changelog file" + required: false + default: "CHANGELOG.md" diff --git a/index.js b/index.js index 25b143a..9935fba 100644 --- a/index.js +++ b/index.js @@ -2,12 +2,11 @@ const core = require('@actions/core'); const github = require('@actions/github'); const fs = require('fs'); -const DEFAULT_CHANGELOG_FILE_PATH = 'CHANGELOG.md' const VERSION_REGEX = /## \[(.+)] - (.+)/ async function run() { const octokit = github.getOctokit(core.getInput("github-token", { required: true })); - const changelogFile = core.getInput("path") || DEFAULT_CHANGELOG_FILE_PATH + const changelogFile = core.getInput("path") const entry = getLatestChangelogEntry(changelogFile) if (!entry) { console.log(`Could not find the latest release from ${changelogFile}`)