fix imports
This commit is contained in:
parent
61b881c67f
commit
fa8bd05312
12
action.js
12
action.js
@ -1,8 +1,7 @@
|
|||||||
const core = require('@actions/core');
|
import * as core from 'actions/core';
|
||||||
const github = require('@actions/github');
|
import * as github from '@actions/github';
|
||||||
const process = require('process');
|
import * as process from 'process';
|
||||||
|
import * as semverParser from 'semver-parser';
|
||||||
import { compareSemVer, isValidSemVer, parseSemVer } from 'semver-parser';
|
|
||||||
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -14,6 +13,7 @@ try {
|
|||||||
const isTag = github.context.ref.startsWith("refs/tags/")
|
const isTag = github.context.ref.startsWith("refs/tags/")
|
||||||
core.setOutput("git_is_tag", isTag ? "true" : "false")
|
core.setOutput("git_is_tag", isTag ? "true" : "false")
|
||||||
|
|
||||||
|
|
||||||
if(!isTag) {
|
if(!isTag) {
|
||||||
const baseRef = github.context.payload?.pull_request?.base?.ref || process.env.BODY_REF
|
const baseRef = github.context.payload?.pull_request?.base?.ref || process.env.BODY_REF
|
||||||
const headRef = github.context.payload?.pull_request?.head?.ref || process.env.HEAD_REF
|
const headRef = github.context.payload?.pull_request?.head?.ref || process.env.HEAD_REF
|
||||||
@ -22,7 +22,7 @@ try {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// const parsed = parseSemVer("1.1.1+abc")
|
// const parsed = semverParser.parseSemVer("1.1.1+abc")
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
core.setFailed(error.message);
|
core.setFailed(error.message);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user