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

Allow the workflow to push directly to the default branch #14

Merged
merged 8 commits into from
Mar 18, 2021

Conversation

samagius
Copy link
Contributor

For complete automation it was required that files are synced without the need for user interaction. If the option SKIP_PR is set to true (defaulted to false), it will push the changes without a PR.

src/config.js Outdated
}),
SKIP_PR: getVar({
key: 'SKIP_PR',
required: false,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

required defaults to false, so you can remove it here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

@@ -89,7 +89,12 @@ const context = {
GITHUB_REPOSITORY: getVar({
key: 'GITHUB_REPOSITORY',
required: true
})
}),
SKIP_PR: getVar({
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As the option only accepts true or false, specify the type like this:

type: 'boolean'

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

@BetaHuhn
Copy link
Owner

Thanks for this great PR, this something I had on my mind, but haven’t implemented yet.

If you address the small changes I will merge this ASAP.

PS: Thanks for correcting my spelling mistakes too 😄

@samagius
Copy link
Contributor Author

Thanks for this great PR, this something I had on my mind, but haven’t implemented yet.

If you address the small changes I will merge this ASAP.

PS: Thanks for correcting my spelling mistakes too 😄

I updated all the changes you mentioned. The feature came really useful for automation, awesome work on the action!

@BetaHuhn
Copy link
Owner

I updated all the changes you mentioned. The feature came really useful for automation, awesome work on the action!

Thanks! Will merge this later today 👍

await git.createPrBranch()

// Check for existing PR and add warning message that the PR maybe about to change
const existingPr = OVERWRITE_EXISTING_PR ? await git.findExistingPr() : undefined
Copy link
Owner

@BetaHuhn BetaHuhn Mar 18, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

existingPr needs to be declared outside of this if statement because it is used later.

@@ -118,12 +122,18 @@ const run = async () => {
if (hasChanges === false && modified.length < 1) {
core.info('File(s) already up to date')

if (existingPr) await git.removePrWarning()
if (SKIP_PR) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check is not really necessary, as the PR warning only gets removed if there is an existing PR.

@BetaHuhn
Copy link
Owner

BetaHuhn commented Mar 18, 2021

@villainous-hippogriff I can't push anything to this PR since you made the changes on the master branch of your fork. I will merge this PR into the develop branch and fix the remaining issues there.

@BetaHuhn BetaHuhn changed the base branch from master to develop March 18, 2021 15:19
@BetaHuhn BetaHuhn merged commit f19c37a into BetaHuhn:develop Mar 18, 2021
BetaHuhn added a commit that referenced this pull request Mar 18, 2021
BetaHuhn added a commit that referenced this pull request Mar 18, 2021
Co-authored-by: BetaHuhn <schiller@mxis.ch>
BetaHuhn added a commit that referenced this pull request Mar 18, 2021
Co-authored-by: BetaHuhn <schiller@mxis.ch>
@BetaHuhnBot
Copy link
Collaborator

🎉 This PR is included in version 1.4.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants