Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// entrypoint.js
const { Toolkit } = require("actions-toolkit");
const tools = new Toolkit();
const webPageTest = require("webpagetest");
const argv = tools.arguments;
const { event, payload, sha } = tools.context;
// check pre-requirements
if (!checkForMissingEnv) tools.exit.failure("Failed!");
// run the script
runAudit();
async function runAudit() {
try {
if (event === "push") {
tools.log("### Action triggered! ###");
const { Toolkit } = require('actions-toolkit')
const tools = new Toolkit();
const path = require( 'path');
console.log('Hi Roy');
var ncp = require('ncp').ncp;
const rimraf = require( 'rimraf' );
ncp.limit = 16;
const sourcePath = path.join(__dirname, '../..');
const resultPath = __dirname + '/build';
const zipPath = __dirname + '/caldera-forms.zip';
const zipFolder = require('zip-folder');
const fs = require( 'fs-extra' );
const clients = [
'pro',
___scope___.file("entrypoint.js", function(exports, require, module, __filename, __dirname){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const fs = require("fs");
const path = require("path");
const actions_toolkit_1 = require("actions-toolkit");
const query_1 = require("./query");
const util_1 = require("./util");
const util = require("util");
const ignore_1 = require("ignore");
const exec = util.promisify(require('child_process').exec);
const configFile = '.github/auto-label.json';
const tools = new actions_toolkit_1.Toolkit({
event: ['pull_request.opened', 'pull_request.synchronize'],
});
(async () => {
if (!fs.existsSync(path.join(tools.workspace, configFile))) {
tools.exit.neutral('config file does not exist.');
}
const config = JSON.parse(tools.getFile(configFile));
let result;
try {
result = await query_1.getPullRequestAndLabels(tools, tools.context.issue());
}
catch (error) {
console.error('Request failed: ', error.request, error.message);
tools.exit.failure('getPullRequestAndLabels has been failed.');
}
console.log('Result: ', result);
import * as fs from 'fs';
import * as path from 'path';
import { Toolkit } from 'actions-toolkit';
import {
addLabelsToLabelable,
removeLabelsFromLabelable,
getPullRequestAndLabels,
} from './query';
import { Label, FileEdge, LabelEdge, LabelName } from './interface';
import { getLabelIds } from './util';
import * as util from 'util';
import ignore from 'ignore';
const exec = util.promisify(require('child_process').exec);
const configFile = '.github/auto-label.json';
const tools = new Toolkit({
event: ['pull_request.opened', 'pull_request.synchronize'],
});
(async () => {
if (!fs.existsSync(path.join(tools.workspace, configFile))) {
tools.exit.neutral('config file does not exist.');
}
const config = JSON.parse(tools.getFile(configFile));
let result;
try {
result = await getPullRequestAndLabels(tools, tools.context.issue());
} catch (error) {
console.error('Request failed: ', error.request, error.message);
const { Toolkit } = require("actions-toolkit");
const tools = new Toolkit({
event: ["pull_request.opened", "pull_request.synchronize"]
});
async function main() {
tools.log("### Benchmark starting ###");
await tools.runInWorkspace("cargo", [
"bench",
"--",
"--save-baseline",
"changes"
]);
tools.log("Changes benchmarked");
await tools.runInWorkspace("git", ["checkout", "master"]);
tools.log("Checked out to master branch");
await tools.runInWorkspace("cargo", [
"bench",
module.exports = async tools => {
if (!tools) {
tools = new Toolkit({
event: [
'issue_comment',
'issues',
'pull_request',
'pull_request_review',
'pull_request_review_comment',
'repository_dispatch'
]
})
}
tools.log.star(`Received ${tools.context.event}!`)
tools.log.start('Stale action is booting up!')
tools.log.pending('Retrieving Stale config from `.github/stale.yml`...')
const config = buildConfig(tools)
const { Toolkit } = require("actions-toolkit");
const tools = new Toolkit();
const octokit = tools.createOctokit();
const fs = require("fs");
const eventJSON = tools.context.payload;
const number = eventJSON.pull_request.number;
const commentBody = `
This is LambdaBot š¤. I see that this PR has been merged into Master. I can help deploy the changes for you to AWS Lambda.
If you wish for my help, type !deploy as a new comment on this PR. Only users with push access to the repo will be allowed to push to Lambda.
`;
const params = tools.context.repo({ number, body: commentBody });
octokit.issues.createComment(params);
const { Toolkit } = require("actions-toolkit")
const tools = new Toolkit()
const query = `
query GitHubOpenPullRequestsQuery {
repository(name: "gatsby", owner: "gatsbyjs") {
pullRequests(
orderBy: { direction: ASC, field: UPDATED_AT }
first: 100
states: OPEN
baseRefName: "master"
) {
totalCount
nodes {
createdAt
updatedAt
title
url
author {
const axios = require('axios')
const yaml = require('node-yaml')
const fs = require('fs')
const { execSync } = require('child_process')
const { Toolkit } = require('actions-toolkit')
const tools = new Toolkit()
let options = {
headers: {
Authorization: `bearer ${tools.token}`
}
}
let url = 'https://api.github.com/graphql'
if (tools.arguments.url) {
url = tools.arguments.url
}
let outputFile = 'github-graphql-action.json'
if (tools.arguments.output) {
outputFile = tools.arguments.output
}