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 18, 2022
1 parent bf40841 commit f85d900
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 7 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.

1 change: 0 additions & 1 deletion .github/workflows/app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,6 @@ jobs:
writeSummary: true
dockerfile: Dockerfile


- name: Copy config
run: |
if test -f ./manifests/configs/dev.env; then cp ./manifests/configs/dev.env ./.env; fi
Expand Down
3 changes: 3 additions & 0 deletions src/actions/config-scrapper/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,12 @@ async function action() {
const analysis = analysisFactory({
root: process.cwd(),
actor: github.context.actor,
event: github.context.eventName,
outputs: {},
})

core.info(`run trigged by event=${analysis.event}`);
analysis.outputs.event = analysis.event
analysis.outputs.actor = github.context.actor

await Promise.all([
Expand Down
14 changes: 13 additions & 1 deletion src/actions/config-scrapper/src/deployment.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const fs = require('fs')
const path = require('path')
const core = require("@actions/core");
const github = require("@actions/github");

Expand Down Expand Up @@ -61,8 +63,18 @@ module.exports = async (analysis) => {
analysis.deployment.tags = tags
analysis.deployment.tagsString = tags.join(', ')

let args = ""
if (environment) {
if(fs.existsSync(path.join(analysis.root, 'manifests', 'config', `${environment}.env`))) {
args = fs.readFileSync(path.join(analysis.root, 'manifests', 'config', `${environment}.env`)).toString()
args = args.replace('\n', ', ')
}
}

analysis.deployment.build_args = args

// outputs
analysis.outputs.event = analysis.event
analysis.outputs.deploy_tag = analysis.deployment.tag
analysis.outputs.deploy_tags = analysis.deployment.tagsString
analysis.outputs.build_args = analysis.deployment.build_args
}
3 changes: 0 additions & 3 deletions src/actions/config-scrapper/src/git.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ const core = require("@actions/core");
const github = require("@actions/github");

module.exports = async (analysis) => {
analysis.event = github.context.eventName
core.info(`run trigged by event=${analysis.event}`);

if (github.context.payload.head_commit) {
analysis.commiter = { ...github.context.payload.head_commit.committer}

Expand Down

0 comments on commit f85d900

Please sign in to comment.