mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-13 17:22:15 -05:00
27 lines
935 B
TypeScript
27 lines
935 B
TypeScript
/*---------------------------------------------------------------------------------------------
|
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
|
*--------------------------------------------------------------------------------------------*/
|
|
|
|
import * as core from '@actions/core'
|
|
import { context } from '@actions/github'
|
|
import { OctoKitIssue } from '../api/octokit'
|
|
import { getRequiredInput, logErrorToIssue, logRateLimit } from '../utils/utils'
|
|
|
|
const token = getRequiredInput('token');
|
|
const label = getRequiredInput('label');
|
|
|
|
async function main() {
|
|
|
|
const pr = new OctoKitIssue(token, context.repo, { number: context.issue.number });
|
|
|
|
pr.addLabel(label);
|
|
}
|
|
|
|
main()
|
|
.then(() => logRateLimit(token))
|
|
.catch(async (error) => {
|
|
core.setFailed(error.message)
|
|
await logErrorToIssue(error.message, true, token)
|
|
})
|