import * as core from '@actions/core' ; import * as github from '@actions/github' ; import { resolveConfiguration , retrieveRepositoryPath , writeOutput } from './utils' ; import { ReleaseNotesBuilder } from './releaseNotesBuilder' ; async function run ( ) { core . setOutput ( 'failed' , false ) ; core . startGroup ( `📘 Reading input values` ) ; try { const inputPath = core . getInput ( 'path' ) ; const repositoryPath = retrieveRepositoryPath ( inputPath ) ; const configurationFile = core . getInput ( 'configuration' ) ; const configuration = resolveConfiguration ( repositoryPath , configurationFile ) ; const baseUrl = core . getInput ( 'baseUrl' ) ; const token = core . getInput ( 'token' ) ; const owner = core . getInput ( 'owner' ) || github . context . repo . owner ; const repo = core . getInput ( 'repo' ) || github . context . repo . repo ; const fromTag = core . getInput ( 'fromTag' ) ; const toTag = core . getInput ( 'toTag' ) ; const ignorePreReleases = core . getInput ( 'ignorePreReleases' ) === 'true' ; const failOnError = core . getInput ( 'failOnError' ) === 'true' ; const commitMode = core . getInput ( 'commitMode' ) === 'true' ; const result = await new ReleaseNotesBuilder ( baseUrl , token , repositoryPath , owner , repo , fromTag , toTag , failOnError , ignorePreReleases , commitMode , configuration ) . build ( ) ; core . setOutput ( 'changelog' , result ) ; const outputFile = core . getInput ( 'outputFile' ) ; if ( outputFile !== '' ) { core . debug ( `Enabled writing the changelog to disk` ) ; writeOutput ( repositoryPath , outputFile , result ) ; } } catch ( error ) { core . setFailed ( error . message ) ; } } run ( ) ;