Commit graph

440 commits

Author SHA1 Message Date
Ayaz BADOURALY
7dcd0bc1bb
Rewrite contexts before evaluating them ()
* Rewrite contexts before evaluating them

* Precompile context and expression patterns

* Test trim before rewrite

The current contextPattern is quite constraining and would fail the
rewrite of a context with trailing spaces. Triming happens during the
execution of Interpolate, and these tests aim to detect future breaking
changes on this behavior.

Co-authored-by: Casey Lee <cplee@nektos.com>
2020-06-24 07:08:45 -07:00
Josh Soref
64b8d2afa4
Properly pass format argument to avoid MISSING ()
2020-06-24 07:05:05 -07:00
Jeremy Lempereur
7cc668707b
remove .gitignore before docker cp ()
* Test setup before I try to understand how things work

* Remove .gitignore before we run docker cp
2020-06-23 11:57:24 -07:00
Stan Wohlwend
d4e41a90a2
Fix container volumes being reused sometimes () 2020-06-18 08:21:55 -07:00
Raj Nigam
f5e1bd45b3
Update unit test command to make test () 2020-06-12 15:31:37 -07:00
Michael Heap
dfd1fee7fe
Pull latest changes from ref using cached repo ()
* Pull latest changes from ref using cached repo

Act switched from checking out a branch to checking out
a hash in order to resolve  - see
bc5c23e8e4

This had a side effect of preventing `w.Pull()` from updating
to the latest commit if a ref was a branch/tag and the repo
already exists on disk.

This commit checks if input.Ref is equivalent to the resolved
hash, and runs `r.Fetch()` and checks out the branch for input.Ref
if it is different. `w.Pull()` can then pull the latest changes
before we checkout `*hash` again like normal

* Extract CloneIfRequired to reduce cyclomatic complexity

Co-authored-by: Casey Lee <cplee@nektos.com>
2020-06-09 07:43:26 -07:00
Casey Lee
39667011b8
Merge pull request from arbourd/set-single-workflow
Change -W command to accept a single file
2020-05-27 07:35:59 -07:00
Dylan Arbour
69b8802ab3 Change -W command to accept a single file
Currently setting workflows with the -W (--workflows) flag only accepts
a folder. It is not possible to run a single workflow.yml file.

This commit allows either a single file or a directory to be passed into
the workflows flag.
2020-05-26 23:29:50 -04:00
Gabriel Joshua Paet
a3a85938ad
Added documentation for module not found issue. ()
* Added documentation for module not found issue.

* Linked the open issue .
2020-05-26 09:12:17 -07:00
Josh Soref
c46ba93adb
Update brand name for macOS () 2020-05-20 08:37:29 -07:00
Josh Soref
5c850b5ba8
Fix using: node12 handling ()
Co-authored-by: Casey Lee <cplee@nektos.com>
2020-05-18 14:31:09 -07:00
Josh Soref
2bb9906425
Markup for runners () 2020-05-18 09:54:59 -07:00
Josh Soref
2097a3c017
Spelling ()
* spelling: cartesian

* spelling: deferring

* spelling: marshal
2020-05-18 09:53:42 -07:00
Josh Soref
2f3187ebcd
Grammar ()
* spelling: GitHub

* Spelling and grammar
2020-05-15 12:30:49 -07:00
Michael Heap
d3f25bac79
Mask secrets in job output ()
Previously secrets would be shown in log output as provided. This
commit updates the stepLogFormatter to replace any instance of the secret
string with "***", as GitHub Actions would

Known issues: If the secret is a generic string (such as "docker"), all
occurances of that string will be replaced in the output

Co-authored-by: Casey Lee <cplee@nektos.com>
2020-05-13 15:22:31 -07:00
Michael Heap
a5e86bd024
Add support for changing the GITHUB_ACTOR ()
This adds the `-a` flag when running `act` to change the username of the GITHUB_ACTOR environment variable

Co-authored-by: Casey Lee <cplee@nektos.com>
2020-05-12 00:14:56 -07:00
Torbjørn Vatn
a149cf8ca2
Make envs available in if conditionals ()
* Ignore .idea

* Add Env to the RunContext vm so we can Evaluate and Interpolate `env.xx`

* Make EvalBool support expressions more in line with the github runner

* Turns out Boolean(value) is what github is doing after all

* Add test for github context as well
2020-05-04 12:18:13 -07:00
Michael Heap
6d6ea7ac04
Implement UnmarshalYAML for ActionRunsUsing ()
In  I added case normalisation to ReadAction() to ensure that Docker and docker are interpreted the same way.

I realised that this was being done at the wrong level and required multiple type conversions. By implementing `func (a ActionRunsUsing) UnmarshalYAML` we can lowercase the string as it's being unserialized

This has an added benefit that any time this type is hydrated the `runs.using` key will be lowercased, rather than relying on `ReadAction()`
2020-05-04 05:40:11 -07:00
Sven Dowideit
6196436f70
extract the docker NewClientWithOpts, and add connectionhelper for DOCKER_HOST set to ssh://remote ()
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>

Co-authored-by: Casey Lee <cplee@nektos.com>
2020-05-03 21:15:42 -07:00
Michael Heap
ef9fab9fad
Normalise Runs.Using to lowercase ()
Currently, providing `using: Docker` is an error as the switch statement in `step_context.go` is case sensitive.

Actions run successfully on GitHub with `using: Docker` leading me to believe that they're case insensitive. This commit updates `act` to match

Co-authored-by: Casey Lee <cplee@nektos.com>
2020-05-03 20:59:13 -07:00
Michael Heap
195a6c9ffb
Add default error case for Runs.Using ()
The string comparison in `step_context.go` is currently case sensitive. This commit adds an error that returns the valid options and tells the user what value they passed
2020-05-03 20:55:20 -07:00
Casey Lee
a48cce3a78
fix: add RUNNER_TEMP 2020-04-23 08:18:36 -07:00
Casey Lee
a9533b05ce
fix: - add RUNNER_OS and RUNNER_TEMP 2020-04-22 23:57:36 -07:00
Casey Lee
c44b71c996
fix: ignore symlink errors 2020-04-22 23:48:25 -07:00
Casey Lee
8c290994c1
fix: - support symlinks in workspace 2020-04-22 23:24:31 -07:00
Casey Lee
6c4e7b9fde
fix: 168 include error message from docker SDK 2020-04-22 23:04:28 -07:00
Juan Eugenio Abadie
b95fdb896f
Use env variables in Action.Runs.Env ()
* Use env variables in Action.Runs.Env

* Use Action.Runs.Env in all the cases
2020-04-19 11:29:34 -07:00
jony montana
2f395475b0
feat: load every environment from --env-file to workflow ()
* feat: load every environment from --env-file to workflow

* fix: pass dotenv's environments through by context

* updates to support --secret-file

Co-authored-by: Casey Lee <cplee@nektos.com>
2020-04-17 10:04:40 -07:00
Máximo Cuadros
f6e37a8d67
*: update go-git import () 2020-04-16 16:24:30 -07:00
Tomer Keren
320b0b8127
Add install instructions from Scoop () 2020-04-16 16:22:47 -07:00
Alberto Fernández
67542608a2
Remove length constraint () 2020-04-16 16:05:00 -07:00
Aidan Steele
bf3824cc10
Improved gitignore handling () 2020-03-18 06:55:39 -07:00
Aidan Steele
4a4bd36cf6
Add support for runs-on array form (closes ) ()
* Add support for runs-on array form (closes )

* Fixed style issues

Co-authored-by: Casey Lee <cplee@nektos.com>
2020-03-16 14:58:10 -07:00
Aidan Steele
fea9a8afa5
Use “push” event workflow(s) if defined (closes ) () 2020-03-15 22:29:13 -07:00
Casey Lee
f5e67f2b86
fix - disable dryrun in git clone 2020-03-14 00:13:18 -07:00
Aidan Steele
b670173764
Add support for step.working-directory (closes ) () 2020-03-14 00:00:37 -07:00
Casey Lee
d2d5c90a36
Merge branch 'master' of github.com:nektos/act 2020-03-13 23:39:15 -07:00
Casey Lee
3baf626aa4
add file info to files cp into container 2020-03-13 23:21:25 -07:00
Yannik Sander
25e1ad687d
Include install instructions for nix () 2020-03-13 07:55:20 -07:00
Casey Lee
d18e21dbd0
Merge branch 'master' of github.com:nektos/act 2020-03-12 17:23:07 -07:00
Casey Lee
c439a6ff14
support nested expressions 2020-03-12 17:22:33 -07:00
David Lozano Jarque
f6b761378a
docs(README): add --env-file flag () 2020-03-12 09:54:05 -07:00
Casey Lee
7f88f81bf6
fix - exclude anything in .gitignore from being copied into the job volume 2020-03-09 18:32:48 -07:00
Casey Lee
b7fcf137ab
Fix 132 - support for chocolatey install ()
* fix  - publish chocolatey package for act

* add missing files to pass validation

* remove extra choco step
2020-03-09 17:49:55 -07:00
Casey Lee
16520bb277
fix - support actions/checkout for repos other the one for this workflow () 2020-03-09 17:45:42 -07:00
Casey Lee
143676fcfb
fix - use host network to match GitHub Actions runners () 2020-03-09 17:43:24 -07:00
Casey Lee
bd6f232b20
fix build for windows 2020-03-06 17:08:07 -08:00
Jacob Turner
2157ef76e8
Add flags to README ()
Co-authored-by: Casey Lee <cplee@nektos.com>
2020-03-06 17:06:07 -08:00
Jacob Turner
643f8d08b7
Add event documentation () 2020-03-06 17:05:36 -08:00
chenrui
ca648a37c8
chore(deps): cleanup go.mod a little bit ()
* Upgrade docker to v19.03.7

* go mod vendor

* golangci-lint 1.23.8
2020-03-06 14:37:54 -08:00