Skip to content

Commit

Permalink
fix: empty commit for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Filipe Forattini committed Jul 11, 2022
1 parent c443c83 commit 479827d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/actions/pipeline-config-scrapper/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .github/actions/pipeline-config-scrapper/index.js.map

Large diffs are not rendered by default.

19 changes: 15 additions & 4 deletions src/actions/pipeline-config-scrapper/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
const _ = require('lodash')
const core = require("@actions/core");
const github = require("@actions/github");

const scrappers = require("./src");
const { newAnalysisBag } = require("./core");

const analysisFactory = (initial = {}) => new Proxy(initial, {
set(obj, prop, value) {
if (!obj[prop]) obj[prop] = {}

obj[prop] = _.isObject(value)
? _.merge(obj[prop], value)
: value
}
})

async function action() {
await core.summary
Expand All @@ -17,8 +27,10 @@ async function action() {
)
.write();

const analysis = newAnalysisBag();
analysis.root = process.cwd();
const analysis = analysisFactory({
root: process.cwd(),
actor: github.context.actor,
})

await scrappers.code(analysis);
await scrappers.git(analysis);
Expand All @@ -27,7 +39,6 @@ async function action() {

core.setOutput("event", analysis.event);
core.setOutput("analysis", JSON.stringify(analysis, null, 2));
analysis.actor = github.context.actor;

await core.summary
.addRaw(
Expand Down

0 comments on commit 479827d

Please sign in to comment.