mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Refactor github actions and add copycat (#10215)
* add actions * disable copycat, fix action location * dont look for env for token
This commit is contained in:
26
build/actions/auto-labeler/index.ts
Normal file
26
build/actions/auto-labeler/index.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* 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)
|
||||
})
|
||||
Reference in New Issue
Block a user