Add and configure ESLint and update configuration for Prettier (#26)
* Add ESLint and Prettier * Rebuild action * Update package.json * Update licenses * Fix review pointspull/27/head
parent
87579b14ff
commit
9169aa7609
@ -0,0 +1,6 @@
|
|||||||
|
# Ignore list
|
||||||
|
/*
|
||||||
|
|
||||||
|
# Do not ignore these folders:
|
||||||
|
!__tests__/
|
||||||
|
!src/
|
@ -0,0 +1,49 @@
|
|||||||
|
module.exports = {
|
||||||
|
extends: [
|
||||||
|
'eslint:recommended',
|
||||||
|
'plugin:@typescript-eslint/recommended',
|
||||||
|
'plugin:eslint-plugin-jest/recommended',
|
||||||
|
'eslint-config-prettier'
|
||||||
|
],
|
||||||
|
parser: '@typescript-eslint/parser',
|
||||||
|
plugins: ['@typescript-eslint', 'eslint-plugin-jest'],
|
||||||
|
rules: {
|
||||||
|
'@typescript-eslint/no-require-imports': 'error',
|
||||||
|
'@typescript-eslint/no-non-null-assertion': 'off',
|
||||||
|
'@typescript-eslint/no-explicit-any': 'off',
|
||||||
|
'@typescript-eslint/no-empty-function': 'off',
|
||||||
|
'@typescript-eslint/ban-ts-comment': [
|
||||||
|
'error',
|
||||||
|
{
|
||||||
|
'ts-ignore': 'allow-with-description'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
'no-console': 'error',
|
||||||
|
'yoda': 'error',
|
||||||
|
'prefer-const': [
|
||||||
|
'error',
|
||||||
|
{
|
||||||
|
destructuring: 'all'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
'no-control-regex': 'off',
|
||||||
|
'no-constant-condition': ['error', {checkLoops: false}]
|
||||||
|
},
|
||||||
|
overrides: [
|
||||||
|
{
|
||||||
|
files: ['**/*{test,spec}.ts'],
|
||||||
|
rules: {
|
||||||
|
'@typescript-eslint/no-unused-vars': 'off',
|
||||||
|
'jest/no-standalone-expect': 'off',
|
||||||
|
'jest/no-conditional-expect': 'off',
|
||||||
|
'no-console': 'off',
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
env: {
|
||||||
|
node: true,
|
||||||
|
es6: true,
|
||||||
|
'jest/globals': true
|
||||||
|
}
|
||||||
|
};
|
@ -0,0 +1,2 @@
|
|||||||
|
* text=auto eol=lf
|
||||||
|
.licenses/** -diff linguist-generated=true
|
@ -0,0 +1,7 @@
|
|||||||
|
# Ignore list
|
||||||
|
/*
|
||||||
|
|
||||||
|
# Do not ignore these folders:
|
||||||
|
!__tests__/
|
||||||
|
!.github/
|
||||||
|
!src/
|
@ -0,0 +1,10 @@
|
|||||||
|
module.exports = {
|
||||||
|
printWidth: 80,
|
||||||
|
tabWidth: 2,
|
||||||
|
useTabs: false,
|
||||||
|
semi: true,
|
||||||
|
singleQuote: true,
|
||||||
|
trailingComma: 'none',
|
||||||
|
bracketSpacing: false,
|
||||||
|
arrowParens: 'avoid'
|
||||||
|
};
|
@ -1,39 +1,43 @@
|
|||||||
import * as github from "@actions/github";
|
import * as github from '@actions/github';
|
||||||
import * as apiUtils from "../src/api-utils";
|
import * as apiUtils from '../src/api-utils';
|
||||||
|
|
||||||
const prereleaseData = require("./data/pre-release.json");
|
import prereleaseData from './data/pre-release.json';
|
||||||
const releaseData = require("./data/release.json");
|
import releaseData from './data/release.json';
|
||||||
|
|
||||||
const token = "faketoken";
|
const token = 'faketoken';
|
||||||
const octokitClient = github.getOctokit(token);
|
const octokitClient = github.getOctokit(token);
|
||||||
|
|
||||||
let getReleaseSpy: jest.SpyInstance;
|
let getReleaseSpy: jest.SpyInstance;
|
||||||
|
|
||||||
process.env.GITHUB_REPOSITORY = "test/repository";
|
process.env.GITHUB_REPOSITORY = 'test/repository';
|
||||||
|
|
||||||
describe("validateIfReleaseIsPublished", () => {
|
describe('validateIfReleaseIsPublished', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
getReleaseSpy = jest.spyOn(octokitClient.repos, "getReleaseByTag");
|
getReleaseSpy = jest.spyOn(octokitClient.repos, 'getReleaseByTag');
|
||||||
});
|
});
|
||||||
|
|
||||||
it("throw if release is marked as pre-release", async () => {
|
it('throw if release is marked as pre-release', async () => {
|
||||||
getReleaseSpy.mockReturnValue(prereleaseData);
|
getReleaseSpy.mockReturnValue(prereleaseData);
|
||||||
|
|
||||||
expect.assertions(1);
|
expect.assertions(1);
|
||||||
await expect(apiUtils.validateIfReleaseIsPublished("v1.0.0", octokitClient)).rejects.toThrowError(
|
await expect(
|
||||||
"The 'v1.0.0' release is marked as pre-release. Updating tags for pre-release is not supported"
|
apiUtils.validateIfReleaseIsPublished('v1.0.0', octokitClient)
|
||||||
);
|
).rejects.toThrow(
|
||||||
});
|
"The 'v1.0.0' release is marked as pre-release. Updating tags for pre-release is not supported"
|
||||||
|
);
|
||||||
it("validate that release is published", async () => {
|
});
|
||||||
getReleaseSpy.mockReturnValue(releaseData);
|
|
||||||
|
it('validate that release is published', async () => {
|
||||||
expect.assertions(1);
|
getReleaseSpy.mockReturnValue(releaseData);
|
||||||
await expect(apiUtils.validateIfReleaseIsPublished("v1.1.0", octokitClient)).resolves.not.toThrow();
|
|
||||||
});
|
expect.assertions(1);
|
||||||
|
await expect(
|
||||||
afterEach(() => {
|
apiUtils.validateIfReleaseIsPublished('v1.1.0', octokitClient)
|
||||||
jest.resetAllMocks();
|
).resolves.not.toThrow();
|
||||||
jest.clearAllMocks();
|
});
|
||||||
});
|
|
||||||
|
afterEach(() => {
|
||||||
|
jest.resetAllMocks();
|
||||||
|
jest.clearAllMocks();
|
||||||
|
});
|
||||||
});
|
});
|
@ -1,69 +1,93 @@
|
|||||||
import * as versionUtils from "../src/version-utils";
|
import * as versionUtils from '../src/version-utils';
|
||||||
|
import stableSemver from './data/stable-semver.json';
|
||||||
|
import stableBuildSemver from './data/stable-build-semver.json';
|
||||||
|
import prereleaseSemver from './data/prerelease-semver.json';
|
||||||
|
import prereleaseBuildSemver from './data/prerelease-build-semver.json';
|
||||||
|
|
||||||
describe("isStableSemverVersion", () => {
|
describe('isStableSemverVersion', () => {
|
||||||
it("validate if a version is stable", () => {
|
it('validate if a version is stable', () => {
|
||||||
const semverVersion = require("./data/stable-semver.json");
|
expect(
|
||||||
expect(versionUtils.isStableSemverVersion(semverVersion)).toBeTruthy();
|
versionUtils.isStableSemverVersion(stableSemver as any)
|
||||||
});
|
).toBeTruthy();
|
||||||
|
});
|
||||||
|
|
||||||
it("validate if a version with build metadata is stable", () => {
|
it('validate if a version with build metadata is stable', () => {
|
||||||
const semverVersion = require("./data/stable-build-semver.json");
|
expect(
|
||||||
expect(versionUtils.isStableSemverVersion(semverVersion)).toBeTruthy();
|
versionUtils.isStableSemverVersion(stableBuildSemver as any)
|
||||||
});
|
).toBeTruthy();
|
||||||
|
});
|
||||||
|
|
||||||
it("validate if a pre-release version is not stable", () => {
|
it('validate if a pre-release version is not stable', () => {
|
||||||
const semverVersion = require("./data/prerelease-semver.json");
|
expect(
|
||||||
expect(versionUtils.isStableSemverVersion(semverVersion)).toBeFalsy();
|
versionUtils.isStableSemverVersion(prereleaseSemver as any)
|
||||||
});
|
).toBeFalsy();
|
||||||
|
});
|
||||||
|
|
||||||
it("validate if a pre-release version with build metadata is not stable", () => {
|
it('validate if a pre-release version with build metadata is not stable', () => {
|
||||||
const semverVersion = require("./data/prerelease-build-semver.json");
|
expect(
|
||||||
expect(versionUtils.isStableSemverVersion(semverVersion)).toBeFalsy();
|
versionUtils.isStableSemverVersion(prereleaseBuildSemver as any)
|
||||||
});
|
).toBeFalsy();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("validateSemverVersionFromTag", () => {
|
describe('validateSemverVersionFromTag', () => {
|
||||||
it("validate a tag containing an valid semantic version", () => {
|
it('validate a tag containing a valid semantic version', () => {
|
||||||
expect(() => versionUtils.validateSemverVersionFromTag("1.0.0")).not.toThrow();
|
expect(() =>
|
||||||
});
|
versionUtils.validateSemverVersionFromTag('1.0.0')
|
||||||
|
).not.toThrow();
|
||||||
|
});
|
||||||
|
|
||||||
it("validate a tag containing an valid semantic version with 'v' prefix", () => {
|
it("validate a tag containing a valid semantic version with 'v' prefix", () => {
|
||||||
expect(() => versionUtils.validateSemverVersionFromTag("v1.0.0")).not.toThrow();
|
expect(() =>
|
||||||
});
|
versionUtils.validateSemverVersionFromTag('v1.0.0')
|
||||||
|
).not.toThrow();
|
||||||
|
});
|
||||||
|
|
||||||
it("validate a tag containing an valid semantic version with build metadata", () => {
|
it('validate a tag containing a valid semantic version with build metadata', () => {
|
||||||
expect(() => versionUtils.validateSemverVersionFromTag("v1.0.0+20130313144700")).not.toThrow();
|
expect(() =>
|
||||||
});
|
versionUtils.validateSemverVersionFromTag('v1.0.0+20130313144700')
|
||||||
|
).not.toThrow();
|
||||||
|
});
|
||||||
|
|
||||||
it("throw when a tag contains an invalid semantic version", () => {
|
it('throw when a tag contains an invalid semantic version', () => {
|
||||||
expect(() => versionUtils.validateSemverVersionFromTag("1.0.0invalid")).toThrowError(
|
expect(() =>
|
||||||
"The '1.0.0invalid' doesn't satisfy semantic versioning specification"
|
versionUtils.validateSemverVersionFromTag('1.0.0invalid')
|
||||||
);
|
).toThrow(
|
||||||
});
|
"The '1.0.0invalid' doesn't satisfy semantic versioning specification"
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
it("throw when a tag contains an valid unstable semantic version", () => {
|
it('throw when a tag contains a valid unstable semantic version', () => {
|
||||||
expect(() => versionUtils.validateSemverVersionFromTag("v1.0.0-beta.1")).toThrowError(
|
expect(() =>
|
||||||
"It is not allowed to specify pre-release version to update the major tag"
|
versionUtils.validateSemverVersionFromTag('v1.0.0-beta.1')
|
||||||
);
|
).toThrow(
|
||||||
});
|
'It is not allowed to specify pre-release version to update the major tag'
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
it("throw when a tag contains an valid unstable semantic version with build metadata", () => {
|
it('throw when a tag contains a valid unstable semantic version with build metadata', () => {
|
||||||
expect(() => versionUtils.validateSemverVersionFromTag("v1.0.0-beta.1+20130313144700")).toThrowError(
|
expect(() =>
|
||||||
"It is not allowed to specify pre-release version to update the major tag"
|
versionUtils.validateSemverVersionFromTag('v1.0.0-beta.1+20130313144700')
|
||||||
);
|
).toThrow(
|
||||||
});
|
'It is not allowed to specify pre-release version to update the major tag'
|
||||||
|
);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("getMajorTagFromFullTag", () => {
|
describe('getMajorTagFromFullTag', () => {
|
||||||
describe("get a valid major tag from full tag", () => {
|
describe('get a valid major tag from full tag', () => {
|
||||||
it.each([
|
it.each([
|
||||||
["1.0.0", "1"],
|
['1.0.0', '1'],
|
||||||
["v1.0.0", "v1"],
|
['v1.0.0', 'v1'],
|
||||||
["v1.0.0-beta.1", "v1"],
|
['v1.0.0-beta.1', 'v1'],
|
||||||
["v1.0.0+20130313144700", "v1"],
|
['v1.0.0+20130313144700', 'v1']
|
||||||
] as [string, string][])("%s -> %s", (sourceTag: string, expectedMajorTag: string) => {
|
] as [string, string][])(
|
||||||
const resultantMajorTag = versionUtils.getMajorTagFromFullTag(sourceTag);
|
'%s -> %s',
|
||||||
expect(resultantMajorTag).toBe(expectedMajorTag);
|
(sourceTag: string, expectedMajorTag: string) => {
|
||||||
});
|
const resultantMajorTag =
|
||||||
});
|
versionUtils.getMajorTagFromFullTag(sourceTag);
|
||||||
|
expect(resultantMajorTag).toBe(expectedMajorTag);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
});
|
||||||
});
|
});
|
File diff suppressed because it is too large
Load Diff
@ -1,114 +1,115 @@
|
|||||||
import * as core from '@actions/core';
|
import * as core from '@actions/core';
|
||||||
import { context } from '@actions/github';
|
import {context} from '@actions/github';
|
||||||
import { GitHub } from '@actions/github/lib/utils';
|
import {GitHub} from '@actions/github/lib/utils';
|
||||||
import { HttpClient } from '@actions/http-client';
|
import {HttpClient} from '@actions/http-client';
|
||||||
|
|
||||||
interface GitRef {
|
interface GitRef {
|
||||||
ref: string;
|
ref: string;
|
||||||
node_id: string;
|
node_id: string;
|
||||||
|
url: string;
|
||||||
|
object: {
|
||||||
|
type: string;
|
||||||
|
sha: string;
|
||||||
url: string;
|
url: string;
|
||||||
object: {
|
};
|
||||||
type: string;
|
|
||||||
sha: string;
|
|
||||||
url: string;
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function findTag(
|
async function findTag(
|
||||||
tag: string,
|
tag: string,
|
||||||
octokitClient: InstanceType<typeof GitHub>
|
octokitClient: InstanceType<typeof GitHub>
|
||||||
): Promise<GitRef | null> {
|
): Promise<GitRef | null> {
|
||||||
try {
|
try {
|
||||||
const { data: foundTag } = await octokitClient.git.getRef({
|
const {data: foundTag} = await octokitClient.git.getRef({
|
||||||
...context.repo,
|
...context.repo,
|
||||||
ref: `tags/${tag}`
|
ref: `tags/${tag}`
|
||||||
});
|
});
|
||||||
|
|
||||||
return foundTag;
|
return foundTag;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (err.status === 404) {
|
if (err.status === 404) {
|
||||||
return null;
|
return null;
|
||||||
} else {
|
} else {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`Retrieving refs failed with the following error: ${err}`
|
`Retrieving refs failed with the following error: ${err}`
|
||||||
);
|
);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getTagSHA(
|
async function getTagSHA(
|
||||||
tag: string,
|
tag: string,
|
||||||
octokitClient: InstanceType<typeof GitHub>
|
octokitClient: InstanceType<typeof GitHub>
|
||||||
): Promise<string> {
|
): Promise<string> {
|
||||||
const foundTag = await findTag(tag, octokitClient);
|
const foundTag = await findTag(tag, octokitClient);
|
||||||
if (!foundTag) {
|
if (!foundTag) {
|
||||||
throw new Error(
|
throw new Error(`The '${tag}' tag does not exist in the remote repository`);
|
||||||
`The '${tag}' tag does not exist in the remote repository`
|
}
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return foundTag.object.sha;
|
return foundTag.object.sha;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function validateIfReleaseIsPublished(
|
export async function validateIfReleaseIsPublished(
|
||||||
tag: string,
|
tag: string,
|
||||||
octokitClient: InstanceType<typeof GitHub>
|
octokitClient: InstanceType<typeof GitHub>
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
try {
|
try {
|
||||||
const { data: foundRelease } = await octokitClient.repos.getReleaseByTag({
|
const {data: foundRelease} = await octokitClient.repos.getReleaseByTag({
|
||||||
...context.repo,
|
...context.repo,
|
||||||
tag,
|
tag
|
||||||
});
|
});
|
||||||
|
|
||||||
if (foundRelease.prerelease) {
|
if (foundRelease.prerelease) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`The '${foundRelease.name}' release is marked as pre-release. Updating tags for pre-release is not supported`
|
`The '${foundRelease.name}' release is marked as pre-release. Updating tags for pre-release is not supported`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (err.status === 404) {
|
if (err.status === 404) {
|
||||||
throw new Error(
|
throw new Error(`No GitHub release found for the ${tag} tag`);
|
||||||
`No GitHub release found for the ${tag} tag`
|
} else {
|
||||||
);
|
throw new Error(
|
||||||
} else {
|
`Retrieving releases failed with the following error: ${err}`
|
||||||
throw new Error(
|
);
|
||||||
`Retrieving releases failed with the following error: ${err}`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function updateTag(
|
export async function updateTag(
|
||||||
sourceTag: string,
|
sourceTag: string,
|
||||||
targetTag: string,
|
targetTag: string,
|
||||||
octokitClient: InstanceType<typeof GitHub>
|
octokitClient: InstanceType<typeof GitHub>
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
const sourceTagSHA = await getTagSHA(sourceTag, octokitClient);
|
const sourceTagSHA = await getTagSHA(sourceTag, octokitClient);
|
||||||
const foundTargetTag = await findTag(targetTag, octokitClient);
|
const foundTargetTag = await findTag(targetTag, octokitClient);
|
||||||
const refName = `tags/${targetTag}`;
|
const refName = `tags/${targetTag}`;
|
||||||
|
|
||||||
if (foundTargetTag) {
|
if (foundTargetTag) {
|
||||||
core.info(`Updating the '${targetTag}' tag to point to the '${sourceTag}' tag`);
|
core.info(
|
||||||
|
`Updating the '${targetTag}' tag to point to the '${sourceTag}' tag`
|
||||||
|
);
|
||||||
|
|
||||||
await octokitClient.git.updateRef({
|
await octokitClient.git.updateRef({
|
||||||
...context.repo,
|
...context.repo,
|
||||||
ref: refName,
|
ref: refName,
|
||||||
sha: sourceTagSHA,
|
sha: sourceTagSHA,
|
||||||
force: true
|
force: true
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
core.info(`Creating the '${targetTag}' tag from the '${sourceTag}' tag`);
|
core.info(`Creating the '${targetTag}' tag from the '${sourceTag}' tag`);
|
||||||
|
|
||||||
await octokitClient.git.createRef({
|
await octokitClient.git.createRef({
|
||||||
...context.repo,
|
...context.repo,
|
||||||
ref: `refs/${refName}`,
|
ref: `refs/${refName}`,
|
||||||
sha: sourceTagSHA
|
sha: sourceTagSHA
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function postMessageToSlack(slackWebhook: string, message: string): Promise<void> {
|
export async function postMessageToSlack(
|
||||||
const jsonData = {text: message}
|
slackWebhook: string,
|
||||||
const http = new HttpClient();
|
message: string
|
||||||
await http.postJson(slackWebhook, jsonData);
|
): Promise<void> {
|
||||||
|
const jsonData = {text: message};
|
||||||
|
const http = new HttpClient();
|
||||||
|
await http.postJson(slackWebhook, jsonData);
|
||||||
}
|
}
|
@ -1,40 +1,49 @@
|
|||||||
import * as core from '@actions/core';
|
import * as core from '@actions/core';
|
||||||
import * as github from '@actions/github';
|
import * as github from '@actions/github';
|
||||||
import { context } from '@actions/github';
|
import {context} from '@actions/github';
|
||||||
import { updateTag, validateIfReleaseIsPublished, postMessageToSlack } from './api-utils';
|
import {
|
||||||
import { validateSemverVersionFromTag, getMajorTagFromFullTag } from './version-utils';
|
updateTag,
|
||||||
|
validateIfReleaseIsPublished,
|
||||||
|
postMessageToSlack
|
||||||
|
} from './api-utils';
|
||||||
|
import {
|
||||||
|
validateSemverVersionFromTag,
|
||||||
|
getMajorTagFromFullTag
|
||||||
|
} from './version-utils';
|
||||||
|
|
||||||
async function run(): Promise<void> {
|
async function run(): Promise<void> {
|
||||||
try {
|
try {
|
||||||
const token = core.getInput('token');
|
const token = core.getInput('token');
|
||||||
const octokitClient = github.getOctokit(token);
|
const octokitClient = github.getOctokit(token);
|
||||||
const sourceTagName = core.getInput('source-tag');
|
const sourceTagName = core.getInput('source-tag');
|
||||||
|
|
||||||
validateSemverVersionFromTag(sourceTagName);
|
validateSemverVersionFromTag(sourceTagName);
|
||||||
|
|
||||||
await validateIfReleaseIsPublished(sourceTagName, octokitClient);
|
await validateIfReleaseIsPublished(sourceTagName, octokitClient);
|
||||||
|
|
||||||
const majorTag = getMajorTagFromFullTag(sourceTagName);
|
const majorTag = getMajorTagFromFullTag(sourceTagName);
|
||||||
await updateTag(sourceTagName, majorTag, octokitClient);
|
await updateTag(sourceTagName, majorTag, octokitClient);
|
||||||
|
|
||||||
core.setOutput('major-tag', majorTag);
|
core.setOutput('major-tag', majorTag);
|
||||||
core.info(`The '${majorTag}' major tag now points to the '${sourceTagName}' tag`);
|
core.info(
|
||||||
|
`The '${majorTag}' major tag now points to the '${sourceTagName}' tag`
|
||||||
|
);
|
||||||
|
|
||||||
const slackMessage = `The ${majorTag} tag has been successfully updated for the ${context.repo.repo} action to include changes from ${sourceTagName}`;
|
const slackMessage = `The ${majorTag} tag has been successfully updated for the ${context.repo.repo} action to include changes from ${sourceTagName}`;
|
||||||
await reportStatusToSlack(slackMessage);
|
await reportStatusToSlack(slackMessage);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
core.setFailed((error as Error).message);
|
core.setFailed((error as Error).message);
|
||||||
|
|
||||||
const slackMessage = `Failed to update a major tag for the ${context.repo.repo} action`;
|
const slackMessage = `Failed to update a major tag for the ${context.repo.repo} action`;
|
||||||
await reportStatusToSlack(slackMessage);
|
await reportStatusToSlack(slackMessage);
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
async function reportStatusToSlack(message: string): Promise<void> {
|
async function reportStatusToSlack(message: string): Promise<void> {
|
||||||
const slackWebhook = core.getInput('slack-webhook');
|
const slackWebhook = core.getInput('slack-webhook');
|
||||||
if (slackWebhook) {
|
if (slackWebhook) {
|
||||||
await postMessageToSlack(slackWebhook, message);
|
await postMessageToSlack(slackWebhook, message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
run();
|
run();
|
Loading…
Reference in New Issue