Skip to content

Commit

Permalink
Merge pull request #8 from JupiterOne/NO-TICKET/lock-auto-version
Browse files Browse the repository at this point in the history
Lock auto to v11.0.1
  • Loading branch information
i5o authored Sep 8, 2023
2 parents 0804849 + 464151d commit 7ff7dea
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 85 deletions.
59 changes: 18 additions & 41 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2019,14 +2019,6 @@ module.exports = require("path");

/***/ }),

/***/ 477:
/***/ ((module) => {

"use strict";
module.exports = require("querystring");

/***/ }),

/***/ 404:
/***/ ((module) => {

Expand Down Expand Up @@ -2085,47 +2077,32 @@ var __webpack_exports__ = {};
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
(() => {
const core = __nccwpck_require__(186);
const { stringify } = __nccwpck_require__(477);
const npm_auth_token = core.getInput('npm_auth_token', { required: true });
const gh_token = core.getInput('gh_token', { required: true });
const npm_auth_token = core.getInput("npm_auth_token", { required: true });
const gh_token = core.getInput("gh_token", { required: true });

const main = async () => {

const execSync = (__nccwpck_require__(81).execSync);

try {

const gitoutput = execSync('git log -1')
if (gitoutput.includes('skip ci' ))
{
console.log('skipping due to [skip ci] message')
try {
const gitoutput = execSync("git log -1");
if (gitoutput.includes("skip ci")) {
console.log("skipping due to [skip ci] message");
return;
}
execSync(`echo "//registry.npmjs.org/:_authToken=${npm_auth_token}" > .npmrc`,
{stdio: 'inherit'})
execSync('yarn global add auto',
{stdio: 'inherit'})
execSync('yarn install --frozen-lockfile',
{stdio: 'inherit'})
execSync('yarn build',
{stdio: 'inherit'})
execSync('git config user.email "[email protected]"',
{stdio: 'inherit'})
execSync('git config user.email "[email protected]"',
{stdio: 'inherit'})
execSync('git config user.name "j1-internal-automation"',
{stdio: 'inherit'})
execSync('git config --global commit.verbose true',
{stdio: 'inherit'})
execSync('git fetch --tags',
{stdio: 'inherit'})
execSync(`NPM_TOKEN=${npm_auth_token} GH_TOKEN=${gh_token} auto shipit --email [email protected] --name j1-internal-automation`,
{stdio: 'inherit'})
}
catch (error) {
execSync(`echo "//registry.npmjs.org/:_authToken=${npm_auth_token}" > .npmrc`, { stdio: "inherit" });
execSync("yarn global add [email protected]", { stdio: "inherit" });
execSync("yarn install --frozen-lockfile", { stdio: "inherit" });
execSync("yarn build", { stdio: "inherit" });
execSync('git config user.email "[email protected]"', { stdio: "inherit" });
execSync('git config user.email "[email protected]"', { stdio: "inherit" });
execSync('git config user.name "j1-internal-automation"', { stdio: "inherit" });
execSync("git config --global commit.verbose true", { stdio: "inherit" });
execSync("git fetch --tags", { stdio: "inherit" });
execSync(`NPM_TOKEN=${npm_auth_token} GH_TOKEN=${gh_token} auto shipit --email [email protected] --name j1-internal-automation`, { stdio: "inherit" });
} catch (error) {
core.setFailed(error.message);
}
}
};

main();

Expand Down
36 changes: 26 additions & 10 deletions package-lock.json

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

53 changes: 19 additions & 34 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,44 +1,29 @@
const core = require('@actions/core');
const { stringify } = require('querystring');
const npm_auth_token = core.getInput('npm_auth_token', { required: true });
const gh_token = core.getInput('gh_token', { required: true });
const core = require("@actions/core");
const npm_auth_token = core.getInput("npm_auth_token", { required: true });
const gh_token = core.getInput("gh_token", { required: true });

const main = async () => {
const execSync = require("child_process").execSync;

const execSync = require('child_process').execSync;

try {

const gitoutput = execSync('git log -1')
if (gitoutput.includes('skip ci' ))
{
console.log('skipping due to [skip ci] message')
const gitoutput = execSync("git log -1");
if (gitoutput.includes("skip ci")) {
console.log("skipping due to [skip ci] message");
return;
}
execSync(`echo "//registry.npmjs.org/:_authToken=${npm_auth_token}" > .npmrc`,
{stdio: 'inherit'})
execSync('yarn global add auto',
{stdio: 'inherit'})
execSync('yarn install --frozen-lockfile',
{stdio: 'inherit'})
execSync('yarn build',
{stdio: 'inherit'})
execSync('git config user.email "[email protected]"',
{stdio: 'inherit'})
execSync('git config user.email "[email protected]"',
{stdio: 'inherit'})
execSync('git config user.name "j1-internal-automation"',
{stdio: 'inherit'})
execSync('git config --global commit.verbose true',
{stdio: 'inherit'})
execSync('git fetch --tags',
{stdio: 'inherit'})
execSync(`NPM_TOKEN=${npm_auth_token} GH_TOKEN=${gh_token} auto shipit --email [email protected] --name j1-internal-automation`,
{stdio: 'inherit'})
}
catch (error) {
execSync(`echo "//registry.npmjs.org/:_authToken=${npm_auth_token}" > .npmrc`, { stdio: "inherit" });
execSync("yarn global add [email protected]", { stdio: "inherit" });
execSync("yarn install --frozen-lockfile", { stdio: "inherit" });
execSync("yarn build", { stdio: "inherit" });
execSync('git config user.email "[email protected]"', { stdio: "inherit" });
execSync('git config user.email "[email protected]"', { stdio: "inherit" });
execSync('git config user.name "j1-internal-automation"', { stdio: "inherit" });
execSync("git config --global commit.verbose true", { stdio: "inherit" });
execSync("git fetch --tags", { stdio: "inherit" });
execSync(`NPM_TOKEN=${npm_auth_token} GH_TOKEN=${gh_token} auto shipit --email [email protected] --name j1-internal-automation`, { stdio: "inherit" });
} catch (error) {
core.setFailed(error.message);
}
}
};

main();

0 comments on commit 7ff7dea

Please sign in to comment.