mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Fixing port request actions (#19966)
This commit is contained in:
12
build/actions/auto-labeler/action.yml
Normal file
12
build/actions/auto-labeler/action.yml
Normal file
@@ -0,0 +1,12 @@
|
||||
name: 'PR Labeler'
|
||||
description: 'Automatically add a Label to a PR'
|
||||
inputs:
|
||||
token:
|
||||
description: GitHub token with issue, comment, and label read/write permissions
|
||||
default: ${{ github.token }}
|
||||
label:
|
||||
description: Github label to add to the PR
|
||||
required: true
|
||||
runs:
|
||||
using: 'node12'
|
||||
main: 'index.js'
|
||||
22
build/actions/auto-labeler/index.js
Normal file
22
build/actions/auto-labeler/index.js
Normal file
@@ -0,0 +1,22 @@
|
||||
"use strict";
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const core = require("@actions/core");
|
||||
const github_1 = require("@actions/github");
|
||||
const octokit_1 = require("../api/octokit");
|
||||
const utils_1 = require("../utils/utils");
|
||||
const token = utils_1.getRequiredInput('token');
|
||||
const label = utils_1.getRequiredInput('label');
|
||||
async function main() {
|
||||
const pr = new octokit_1.OctoKitIssue(token, github_1.context.repo, { number: github_1.context.issue.number });
|
||||
pr.addLabel(label);
|
||||
}
|
||||
main()
|
||||
.then(() => utils_1.logRateLimit(token))
|
||||
.catch(async (error) => {
|
||||
core.setFailed(error.message);
|
||||
await utils_1.logErrorToIssue(error.message, true, token);
|
||||
});
|
||||
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