From 3d3a3337282f876636e59a463f597373e8be69f5 Mon Sep 17 00:00:00 2001 From: Conor Sloan Date: Mon, 15 Apr 2024 16:11:50 +0100 Subject: [PATCH] remove async in parser --- dist/index.js | 4 ++-- src/main.ts | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/dist/index.js b/dist/index.js index 59fe060..8f60271 100644 --- a/dist/index.js +++ b/dist/index.js @@ -104876,7 +104876,7 @@ async function run() { const options = await cfg.resolvePublishActionOptions(); core.info(`Publishing action package version with options:`); core.info(cfg.serializeOptions(options)); - const semverTag = await parseSemverTagFromRef(options); + const semverTag = parseSemverTagFromRef(options); // Ensure the correct SHA is checked out for the tag we're parsing, otherwise the bundled content will be incorrect. await fsHelper.ensureTagAndRefCheckedOut(options.ref, options.sha, options.workspaceDir); const stagedActionFilesDir = fsHelper.createTempDir(options.runnerTempDir, 'staging'); @@ -104906,7 +104906,7 @@ exports.run = run; // This action can be triggered by any workflow that specifies a tag as its GITHUB_REF. // This includes releases, creating or pushing tags, or workflow_dispatch. // See https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#about-events-that-trigger-workflows. -async function parseSemverTagFromRef(opts) { +function parseSemverTagFromRef(opts) { const ref = opts.ref; if (!ref.startsWith('refs/tags/')) { throw new Error(`The ref ${ref} is not a valid tag reference.`); diff --git a/src/main.ts b/src/main.ts index 51790a6..97073ec 100644 --- a/src/main.ts +++ b/src/main.ts @@ -18,7 +18,7 @@ export async function run(): Promise { core.info(`Publishing action package version with options:`) core.info(cfg.serializeOptions(options)) - const semverTag: semver.SemVer = await parseSemverTagFromRef(options) + const semverTag: semver.SemVer = parseSemverTagFromRef(options) // Ensure the correct SHA is checked out for the tag we're parsing, otherwise the bundled content will be incorrect. await fsHelper.ensureTagAndRefCheckedOut( @@ -84,9 +84,7 @@ export async function run(): Promise { // This action can be triggered by any workflow that specifies a tag as its GITHUB_REF. // This includes releases, creating or pushing tags, or workflow_dispatch. // See https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#about-events-that-trigger-workflows. -async function parseSemverTagFromRef( - opts: cfg.PublishActionOptions -): Promise { +function parseSemverTagFromRef(opts: cfg.PublishActionOptions): semver.SemVer { const ref = opts.ref if (!ref.startsWith('refs/tags/')) {