Skip to content
This repository has been archived by the owner on Mar 15, 2021. It is now read-only.

Commit

Permalink
Checkin @actions/core
Browse files Browse the repository at this point in the history
  • Loading branch information
sidvishnoi committed Oct 25, 2019
1 parent 60159ab commit faae43d
Show file tree
Hide file tree
Showing 6 changed files with 347 additions and 10 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.vscode
node_modules/*
!node_modules/@actions
node_modules/@actions/**/README.md
node_modules/@actions/**/*.map
node_modules/@actions/**/*.d.ts
14 changes: 4 additions & 10 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,22 @@
const https = require('https');
const { existsSync } = require('fs');
const path = require('path');
const { existsSync } = require('fs');
const { spawn } = require('child_process');
const core = require('@actions/core');

// GitHub JavaScript Actions require we "must include any package dependencies
// required to run the JavaScript code" - import node_modules in version control
// or other weird things.
// (https://help.github.com/en/articles/creating-a-javascript-action#commit-and-push-your-action-to-github).
// To overcome that, we do `npm install` dynamically from within this script 🎉.
let core; // this will become lazily imported '@actions/core'

main().catch(err => {
console.error(err);
core && core.setFailed(err);
core.setFailed(err);
process.exit(1);
});

async function main() {
await install(['@actions/core']);
const actionsCore = require.resolve(
path.join(process.cwd(), 'node_modules/@actions/core')
);
core = require(actionsCore);

await core.group('Install dependencies', installDependencies);
await core.group('Validate spec', validate);
await core.group('Publish to /TR/', publish);
Expand Down Expand Up @@ -87,7 +81,7 @@ function shell(command, args = [], options = {}) {
}

async function install(dependencies) {
await shell('npm', ['install', '--quiet', ...dependencies]);
await shell('npm', ['install', '--silent', ...dependencies]);
}

function request(url, options) {
Expand Down
66 changes: 66 additions & 0 deletions node_modules/@actions/core/lib/command.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

195 changes: 195 additions & 0 deletions node_modules/@actions/core/lib/core.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

65 changes: 65 additions & 0 deletions node_modules/@actions/core/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit faae43d

Please sign in to comment.