Commit Graph

15 Commits

Author SHA1 Message Date
Ross Williams
95f8a2cd05
Resolve simultaneous deployments with rebase (#1054)
* Return early from dry run

Determining whether to create a merge commit would elicit a nested
conditional, which could be hard to parse for a human reader. This is
avoided by returning early as soon as possible for a dry run.

This also resolves the erroneous 'changes committed' message when no
changes were actually committed because of the dry run. A message
specific to dry-run is logged instead.

* Add force parameter to action interface

Existing behaviour is equivalent to force=true, so the default value is
true.

* Implement pull+rebase procedure

* Declare force parameter in action

* Detect both rejection syntaxes

* Return both stdout and stderr from execute

* Ignore non-zero exit status on push

* Remove unnecessary error catch

* Fetch and rebase in separate steps

* Explicitly bind incoming branch

I think the fetch will update the origin/gh-pages branch but not the
gh-pages branch, despite requesting gh-pages. This means that when I
later attempt to rebase the temp branch on top of the gh-pages branch,
there will be nothing to do, because that's already where it is.

* Implement attempt limit

I don't expect this to ever require more than one attempt in production,
but in theory it's possible that this procedure could loop forever.

We would need to keep fetching and rebasing if changes keep being added
to the remote. In practice, I believe this would only happen if there
are lots of workflows simultaneously deploying to the same branch, all
using this action. In this case only one would be able to secure a lock
at a time, leading to the total number of attempts being equal to the
number of simultaneous deployments, assuming each deployment makes each
attempt at the exact same time.

The limit may need to be increased or even be configurable, but 3 should
cover most uses.

* Update tests for execute output split

* Document 'force' parameter

* Create integration test for rebase procedure

This test is composed of 3 jobs.

The first two jobs run simultaneously, and as such both depend on the
previous integration test only. The final job cleans up afterwards, and
depends on both of the prior jobs.

The two jobs are identical except that they both create a temporary file
in a different location. This is to ensure that they conflict. Correctly
resolving this conflict by rebasing one deployment over the other,
resulting in a deployment containing both files, indicates a successful
test.
2022-04-04 07:18:27 -04:00
Lukas Larsson
0a83e598dd
Fix output size check (#744) 2021-06-04 09:57:51 -04:00
James Ives
4bb15711fb
Eslint improvements (#686)
* Initial Pass at new configs

* Improved Linting/Formatting

* Update execute.ts

* Update main.test.ts

* Change typing

* Update git.ts

* Update worktree.ts

* Update worktree.ts

* Update worktree.ts

* Maybe

* Update execute.ts
2021-04-26 18:57:10 -04:00
James Ives
f8dc4cf21d
Check buffer length (#668)
* Check buffer len

* Update execute.ts

* Format
2021-04-21 11:03:15 -04:00
James Ives
ab9d9526bc Adjustments 2020-06-26 14:10:06 -04:00
James Ives
b71ad75352
Silent Settings (#347) 2020-06-26 08:18:23 -04:00
James Ives
2f96cedf7a
Single Commit (#226)
* Wipe History #1

* singleCommit

* Integration tests

* Update README.md
2020-03-30 20:44:09 -04:00
JamesIves
397fc01782 Wrap with debug 2020-03-28 13:06:55 -04:00
JamesIves
fb344c2b78 Debugging Changes 2020-03-28 10:35:26 -04:00
JamesIves
9ce7c5f8d0 Linting errors 2020-03-09 09:19:16 -04:00
James Ives
b2acf87217
Migrates to eslint (#193) 2020-03-06 22:36:56 -05:00
JamesIves
d25f74597f Prettier file 2020-03-05 08:19:45 -05:00
James Ives
71b19fd2fb
Package Exporting (#181)
* Corrects exporting

* README Changes

* Forgot the compiled code.

* Configuration changes

* Moving action package

* Update README.md

* Update README.md

* Improving example

* Update README.md

* Update src/lib.ts

Co-Authored-By: XAMPPRocky <4464295+XAMPPRocky@users.noreply.github.com>

* Correctly building types

* Update README.md

* Configuration update

* Update README.md

* Re-assigning

* Missing chnage

* More changes

* Some more information

* Setting changes to repositoryPath and tokenType

* Compiling

* Update package.json

* Token hiding

* Package Exporting Changes (#185)

* Initiial Changes

* Changes to action

* Compiled

* Added better logging for when debug is off...

* Removing base branch logging as it's not really required

* throw new Error -> throw

* Debug flag as an variable

* Update README.md

* More README Changes

* Update README.md

* Update README.md

* Update README.md

* error.message

* Fixes the debug flag

* Changing the directory routing for shell scripting

* Tidying!

* Changing to const

* Promotion

Co-authored-by: XAMPPRocky <4464295+XAMPPRocky@users.noreply.github.com>
2020-03-02 07:52:38 -05:00
James Ives
109bba8860
Test Coverage Improvements (#141)
* Test Coverage Improvements

* Update env.js
2020-01-19 15:33:14 -05:00
James Ives
41de4b88ee Some additional integration test fixes 2020-01-11 20:26:08 -05:00