Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modified: #139

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Deploy to Heroku"
name: "Deploy to Heroku - git-crypt"
description: "Deploy an app to Heroku"
branding:
icon: "upload-cloud"
Expand Down Expand Up @@ -83,6 +83,10 @@ inputs:
description: "If deploying to an organization, then specify the name of the team or organization here"
required: false
default: ""
git_crypt_key:
description: "git-crypt secret key"
required: false
default: ""
outputs:
status:
description: "The Success/Failure of the action"
Expand Down
29 changes: 16 additions & 13 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ let heroku = {
region: core.getInput("region"),
stack: core.getInput("stack"),
team: core.getInput("team"),
git_crypt_key: core.getInput("git_crypt_key"),
};

// Formatting
Expand All @@ -177,21 +178,23 @@ if (heroku.dockerBuildArgs) {
(async () => {
// Program logic
try {
// Just Login
if (heroku.justlogin) {
execSync(createCatFile(heroku));
console.log("Created and wrote to ~/.netrc");
if(!heroku.git_crypt_key) {
// Just Login
if (heroku.justlogin) {
execSync(createCatFile(heroku));
console.log("Created and wrote to ~/.netrc");

return;
}
return;
}

execSync(`git config user.name "Heroku-Deploy"`);
execSync(`git config user.email "${heroku.email}"`);
const status = execSync("git status --porcelain").toString().trim();
if (status) {
execSync(
'git add -A && git commit -m "Commited changes from previous actions"'
);
execSync(`git config user.name "Heroku-Deploy"`);
execSync(`git config user.email "${heroku.email}"`);
const status = execSync("git status --porcelain").toString().trim();
if (status) {
execSync(
'git add -A && git commit -m "Commited changes from previous actions"'
);
}
}

// Check if using Docker
Expand Down