Skip to content

Commit

Permalink
Define path input variable, update Node to 20
Browse files Browse the repository at this point in the history
  • Loading branch information
rasmus-saks committed Feb 23, 2024
1 parent 8ed3925 commit 7d928fc
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -13,3 +13,7 @@ inputs:
github-token:
description: "GitHub token"
required: true
path:
description: "Path to the changelog file"
required: false
default: "CHANGELOG.md"
3 changes: 1 addition & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`)
Expand Down

0 comments on commit 7d928fc

Please sign in to comment.