Commit Graph

89 Commits

Author SHA1 Message Date
Ryan (hackercat) 8153dc92e5
Fix environment variables and move `envs.txt`/`event.json` to fixed location (#667)
* fix: environment variables sourcing from `/etc/environment`

* fix: move `envs.txt` & `event.json` to `/tmp/`

Since #635 `envs.txt` is not copying properly when running `act` in WSL2
Moving it to fixed location resolves that.
2021-05-05 23:11:43 +00:00
Markus Wolf 710a3ac94c
Add custom docker registry authentication (#665)
* Add custom docker registry authentication

Uses DOCKER_USERNAME and DOCKER_PASSWORD as secrets provided into
the act cli.

Closes #527

Co-authored-by: Björn Brauer <zaubernerd@zaubernerd.de>

* Add test to check if pull authentication is filled in

* Update debug message to be more descriptive

Co-authored-by: Ryan (hackercat) <me@hackerc.at>

Co-authored-by: Björn Brauer <zaubernerd@zaubernerd.de>
Co-authored-by: Ryan (hackercat) <me@hackerc.at>
2021-05-05 09:37:17 -07:00
Ryan (hackercat) cec63488f3
Add `super-linter` + fix lint issues (#650)
* feat: bump `golangci-lint`, add `super-linter`, replace outdated linter

Bump `golangci-lint` version.
Add `super-linter` to lint other languages.
Go linter is disabled because it's currently broken:
https://github.com/github/super-linter/pull/370
Replacing `scopelint` with `exportloopref`: "[runner] The linter
'scopelint' is deprecated (since v1.39.0) due to: The repository of the
linter has been deprecated by the owner.  Replaced by exportloopref."
Fixed formatting in `.golangci.yml`
Add addtional linters:
  `misspell`: purely style, detects typos in comments
  `whitespace`: detects leading and trailing whitespace
  `goimports`: it's gofmt + checks unused imports

* fix: lint/fix `go` files

* fix: lint with `standardjs`

* fix: lint/fix with `markdownlint`, make template more verbose

* feat: add lint stuff to makefile

* fix: `UseGitIgnore` formatting

* fix: lint/fix `README.md`

Co-authored-by: Casey Lee <cplee@nektos.com>
2021-05-03 09:52:03 -07:00
Ryan (hackercat) 7ae9916de0
Add option to allow files/directories in `.gitignore` to be copied to container (#537)
* disable gitignore for actions

* feat: Add option to allow/disallow paths specified in .gitignore

Co-authored-by: Alan Birtles <alan.birtles@eu.sony.com>
2021-05-03 07:37:20 -07:00
Ryan (hackercat) f32babb51d
fix: reworked container architecture (#619)
- Don't set architecture, let Docker host decide it's own platform,
  remove `runtime` dependency and don't show default in `--help`
- Remove most tests, we need to check only once if it works on
  different platform
- Rename `DeleteImage` to `RemoveImage` to conform to existing
  function in `docker` cli, added options to specify `force` and
  `pruneChildren`
2021-05-02 08:15:13 -07:00
Jay Pipes d67e282f68
use container image platform only on docker 1.41+ (#591)
Commit af5140f13e introduced support for
specifying a container image platform for cross-platform image building.

Unfortunately, attempting to execute a docker command that includes the
`--platform` flag against Docker daemons using API Version 1.40 and
before results in the following error:

```
"specify container image platform" requires API version 1.41, but the Docker daemon API version is 1.40
```

To allow `act` to be used on the 19.03 Docker CE and earlier versions,
this patch simply checks the Docker daemon API version and only
specifies platform specification when the daemon API version is 1.41 or
greater.

Fixes Issue #586
2021-03-30 10:10:42 -07:00
hackercat 6c258cf40d
Add option to run custom architecture (container platform) (#525)
* Add QEMU to run different architectures

* Update dependencies in `go.mod`

* Add `--container-architecture` flag to specify custom image architecture

Co-authored-by: Casey Lee <cplee@nektos.com>
2021-03-28 21:08:40 -07:00
Hibariya 8de7b956b7
Add --userns flag to support Docker daemon that enables user namespace (#533)
I got an error like this after hitting `act` command.

> Error: Error response from daemon: cannot share the host's network namespace when user namespaces are enabled

According to the document, when user namespaces are enabled on the Docker daemon,
neither host network mode and --privileged work without --userns=host. Since `act`
uses host network mode to match GitHub Actions runners, it cannot run jobs when
user namespaces are enabled. So I added the flag.

https://docs.docker.com/engine/security/userns-remap/#user-namespace-known-limitations

Co-authored-by: Casey Lee <cplee@nektos.com>
2021-02-27 08:31:25 -08:00
KADOTA, Kyohei e6fcfed458
Format sources with gofmt (#472)
Co-authored-by: Casey Lee <cplee@nektos.com>
2021-01-14 21:37:38 -08:00
Cat™ 760daebf5d
Fix slashes when running on Windows (#461) 2021-01-11 22:41:35 -08:00
Torbjørn Vatn 15eaa15a0e
GitHub env file support (#426)
* Upgrade to the official golangci-lint action and fix some issues it found

* Update deps

* Remove a shadow warning

* Initialize the splitPattern only once

* Initial attempt at supporting $GITHUB_ENV

Needs some polishing and tests

* Now it's actually working

* Replace golang.org/x/crypto/ssh/terminal with golang.org/x/term

* Disable the issue-228 test again

* The linter is picky

* Discovered that the workflow/envs.txt had to exist in certain cases

* Fix small linter issue
2021-01-11 22:39:43 -08:00
Lyle Underwood 3d9b82515c
Remove confusing message about symlinks (#381) 2020-10-06 10:02:37 -07:00
Bar Weiss 04456ad234
Fix copyDir to normalize file paths in tar archive (#360) 2020-09-15 07:00:15 -07:00
whywaita 24bdb024bf
add flag of privileged mode 2020-08-02 05:21:49 +09:00
Stan Wohlwend d4e41a90a2
Fix container volumes being reused sometimes (#283) 2020-06-18 08:21:55 -07:00
Josh Soref 2097a3c017
Spelling (#240)
* spelling: cartesian

* spelling: deferring

* spelling: marshal
2020-05-18 09:53:42 -07:00
Sven Dowideit 6196436f70
extract the docker NewClientWithOpts, and add connectionhelper for DOCKER_HOST set to ssh://remote (#207)
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
Casey Lee c44b71c996
fix: ignore symlink errors 2020-04-22 23:48:25 -07:00
Casey Lee 8c290994c1
fix: #182 - 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
Máximo Cuadros f6e37a8d67
*: update go-git import (#194) 2020-04-16 16:24:30 -07:00
Aidan Steele bf3824cc10
Improved gitignore handling (#163) 2020-03-18 06:55:39 -07:00
Casey Lee 3baf626aa4
add file info to files cp into container 2020-03-13 23:21:25 -07:00
Casey Lee 7f88f81bf6
fix #50 - exclude anything in .gitignore from being copied into the job volume 2020-03-09 18:32:48 -07:00
Casey Lee 16520bb277
fix #122 - support actions/checkout for repos other the one for this workflow (#143) 2020-03-09 17:45:42 -07:00
Casey Lee 143676fcfb
fix #141 - use host network to match GitHub Actions runners (#142) 2020-03-09 17:43:24 -07:00
Casey Lee 5b90c8a44d
remove super verbose log statement 2020-02-24 17:58:34 -08:00
Casey Lee 1121f6e132
run with copy of workingdir 2020-02-24 17:48:21 -08:00
Casey Lee 8f5918942d
move action cache to volume 2020-02-24 16:38:49 -08:00
Casey Lee 88041afb87
cache dir for remote actions 2020-02-23 22:34:48 -08:00
Casey Lee 94591c58d7
local actions done 2020-02-23 16:36:44 -08:00
Casey Lee ac1bd0893e
shared container for job 2020-02-23 15:02:01 -08:00
Casey Lee 01876438c2
shared container for job 2020-02-23 15:01:25 -08:00
Casey Lee 73559207c7
initial support for expressons
Signed-off-by: Casey Lee <cplee@nektos.com>
2020-02-20 21:05:59 -05:00
Casey Lee f7252cbcf9
add commands support
Signed-off-by: Casey Lee <cplee@nektos.com>
2020-02-20 21:05:42 -05:00
Casey Lee 033168228b
cleanup logging
Signed-off-by: Casey Lee <cplee@nektos.com>
2020-02-20 21:05:40 -05:00
Casey Lee 0582306861
unit tests
Signed-off-by: Casey Lee <cplee@nektos.com>
2020-02-20 21:05:31 -05:00
Casey Lee 532af98aef
successfully able to run simple workflows
Signed-off-by: Casey Lee <cplee@nektos.com>
2020-02-20 21:05:25 -05:00
Casey Lee 8c49ba0cec
initial load of yaml working 2020-02-04 16:38:41 -08:00