mirror of
https://github.com/Raghu-Ch/angular-challenges.git
synced 2026-02-10 12:53:03 -05:00
feat: improve github action
This commit is contained in:
6
.github/github-action/contributors.js
vendored
6
.github/github-action/contributors.js
vendored
@@ -8,9 +8,11 @@ const contributors = [
|
||||
'wandri',
|
||||
'webbomj',
|
||||
'kabrunko-dev',
|
||||
'Sanjar1304'
|
||||
'Sanjar1304',
|
||||
];
|
||||
|
||||
const sponsors = ['ddotx', 'LMFinney'];
|
||||
|
||||
module.exports = {
|
||||
contributors
|
||||
contributors,
|
||||
};
|
||||
|
||||
12
.github/github-action/index.js
vendored
12
.github/github-action/index.js
vendored
@@ -1,6 +1,6 @@
|
||||
const github = require('@actions/github');
|
||||
const core = require('@actions/core');
|
||||
const { contributors } = require('./contributors');
|
||||
const { contributors, sponsors } = require('./contributors');
|
||||
|
||||
async function run() {
|
||||
try {
|
||||
@@ -13,7 +13,13 @@ async function run() {
|
||||
}
|
||||
|
||||
const actor = github.context.actor;
|
||||
if(contributors.includes(actor)) {
|
||||
if (contributors.includes(actor)) {
|
||||
labels.push('contributor');
|
||||
labels.push('to be reviewed');
|
||||
}
|
||||
|
||||
if (sponsors.includes(actor)) {
|
||||
labels.push('sponsor');
|
||||
labels.push('to be reviewed');
|
||||
}
|
||||
|
||||
@@ -26,7 +32,7 @@ async function run() {
|
||||
labels,
|
||||
owner: github.context.repo.owner,
|
||||
repo: github.context.repo.repo,
|
||||
issue_number: number
|
||||
issue_number: number,
|
||||
});
|
||||
} catch (e) {
|
||||
if (e instanceof Error) {
|
||||
|
||||
Reference in New Issue
Block a user