Skip to content
This repository has been archived by the owner on Nov 24, 2023. It is now read-only.

Commit

Permalink
feat: Build for release
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Jan 18, 2020
1 parent da37fe4 commit 5b8192d
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 7 deletions.
5 changes: 4 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,15 @@ inputs:
description: Get as absolute path.
default: 'true'
required: false
SET_ENV_NAME:
description: Env name.
required: false
outputs:
diff:
description: 'git diff results'
branding:
# https://feathericons.com/
icon: 'package'
icon: 'file'
color: 'orange'
runs:
using: node12
Expand Down
2 changes: 1 addition & 1 deletion build.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"owner":"technote-space","repo":"get-diff-action","sha":"6d7d22d794e2e14c12409e43459e126921c943a0","ref":"refs/tags/v1.0.2","tagName":"v1.0.2","branch":"gh-actions","tags":["v1","v1.0","v1.0.2"],"updated_at":"2020-01-18T17:29:30.228Z"}
{"owner":"technote-space","repo":"get-diff-action","sha":"eeadf7e4f28a01a2db1341f9993e4d6b02c072a4","ref":"refs/tags/v1.0.3","tagName":"v1.0.3","branch":"gh-actions","tags":["v1","v1.0","v1.0.3"],"updated_at":"2020-01-18T19:22:18.262Z"}
9 changes: 4 additions & 5 deletions lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const github_1 = require("@actions/github");
const filter_github_action_1 = require("@technote-space/filter-github-action");
const github_action_helper_1 = require("@technote-space/github-action-helper");
const command_1 = require("./utils/command");
const misc_1 = require("./utils/misc");
const constant_1 = require("./constant");
/**
* run
Expand All @@ -28,14 +29,12 @@ function run() {
github_action_helper_1.ContextHelper.showActionInfo(path_1.default.resolve(__dirname, '..'), logger, github_1.context);
if (!filter_github_action_1.isTargetEvent(constant_1.TARGET_EVENTS, github_1.context)) {
logger.info('This is not target event.');
core_1.setOutput('diff', '');
misc_1.setResult([]);
return;
}
const diff = yield command_1.getGitDiff();
logger.startProcess('Dump output');
console.log(diff);
logger.endProcess();
core_1.setOutput('diff', command_1.getGitDiffOutput(diff));
misc_1.dumpOutput(diff, logger);
misc_1.setResult(diff);
});
}
run().catch(error => core_1.setFailed(error.message));
17 changes: 17 additions & 0 deletions lib/utils/misc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const core_1 = require("@actions/core");
const command_1 = require("./command");
exports.dumpOutput = (diff, logger) => {
logger.startProcess('Dump output');
console.log(diff);
logger.endProcess();
};
exports.setResult = (diff) => {
const result = command_1.getGitDiffOutput(diff);
core_1.setOutput('diff', result);
const envName = core_1.getInput('SET_ENV_NAME');
if (envName) {
core_1.exportVariable(envName, result);
}
};

0 comments on commit 5b8192d

Please sign in to comment.