Skip to content

Commit

Permalink
feat: added dispatch command
Browse files Browse the repository at this point in the history
  • Loading branch information
Filipe Forattini committed Aug 9, 2022
1 parent 57a6fa9 commit ee8fbdc
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/actions/config-scrapper/index.js

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions src/actions/config-scrapper/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ async function action() {
analysis.outputs.event = analysis.event
analysis.outputs.actor = github.context.actor

await scrappers.dispatch(analysis),

await Promise.all([
scrappers.git(analysis),
scrappers.run(analysis),
Expand Down
11 changes: 11 additions & 0 deletions src/actions/config-scrapper/src/dispatch.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const core = require("@actions/core");
const github = require("@actions/github");

module.exports = async (analysis) => {
if (github.context.eventName === 'workflow_dispatch') {
let branch = core.getInput('branch', { required: true });
let environment = core.getInput('environment', { required: true });

analysis.environment = environment
}
}
1 change: 1 addition & 0 deletions src/actions/config-scrapper/src/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module.exports = {
code: require('./code'),
deployment: require('./deployment'),
dispatch: require('./dispatch'),
git: require('./git'),
repository: require('./repository'),
run: require('./run'),
Expand Down

0 comments on commit ee8fbdc

Please sign in to comment.