* feat: implement expression evaluator
Co-authored-by: Markus Wolf <markus.wolf@new-work.se>
Co-authored-by: Philipp Hinrichsen <philipp.hinrichsen@new-work.se>
* feat: integrate exprparser into act
Co-authored-by: Markus Wolf <markus.wolf@new-work.se>
Co-authored-by: Philipp Hinrichsen <philipp.hinrichsen@new-work.se>
* Escape { and }, do not fail on missing properties
* Fix empty inputs context
* fix: contains() comparison for complex values
Co-authored-by: Markus Wolf <markus.wolf@new-work.se>
Co-authored-by: Philipp Hinrichsen <philipp.hinrichsen@new-work.se>
Co-authored-by: Christopher Homberger <christopher.homberger@web.de>
* Add asset server and upload handling of binary files
Co-authored-by: Björn Brauer <zaubernerd@zaubernerd.de>
* Add asset download parts to the asset server
Co-authored-by: Björn Brauer <zaubernerd@zaubernerd.de>
* Add artifact-server-path flag
If the flag is not defined, the artifact server isn't started.
This includes the configuration of ACTIONS_RUNTIME_URL and
ACTIONS_RUNTIME_TOKEN which are set if the server is started.
Co-authored-by: Björn Brauer <zaubernerd@zaubernerd.de>
* Move ACTIONS_RUNTIME_* vars into the withGithubEnv setup
Co-authored-by: Björn Brauer <zaubernerd@zaubernerd.de>
* feat: add artifact server port as flag
This commits adds a flag to define the artifact server port.
If not given, the port defaults to 34567.
Co-authored-by: Björn Brauer <bjoern.brauer@new-work.se>
* test: add artifact server tests
Co-authored-by: Björn Brauer <bjoern.brauer@new-work.se>
* refactor: use fs.FS
This allows to add tests with in-memory file system
* feat: add support for gzip encoded uploads
Co-authored-by: Björn Brauer <bjoern.brauer@new-work.se>
* test: add artifact integration test
* chore: run act tests with asset server path
Co-authored-by: Björn Brauer <bjoern.brauer@new-work.se>
* docs: add new cli flags
Co-authored-by: Björn Brauer <bjoern.brauer@new-work.se>
* test: add test workflow to testdata
* feat: add log output
* refactor: log shutdown error instead of panic
* feat: use outbound ip for the asset server
This change should allow to use the host ip in macos and windows.
Since docker is running in an intermediate vm, localhost is not
sufficient to have the artifacts in the host system.
* fix: do not use canceled context
To shutdown artifact server, we should not use the already canceled
context but the parent context instead.
Co-authored-by: Björn Brauer <zaubernerd@zaubernerd.de>
* feat: shutdown artifact server at end of pipeline
When the pipeline is done the asset server should be shut down
gracefully.
Co-authored-by: Björn Brauer <zaubernerd@zaubernerd.de>
* fix: close server if graceful shutdown failed
Co-authored-by: Björn Brauer <zaubernerd@zaubernerd.de>
* fix: ignore server closed error from listen call
Co-authored-by: Björn Brauer <zaubernerd@zaubernerd.de>
Co-authored-by: Björn Brauer <zaubernerd@zaubernerd.de>
Co-authored-by: Björn Brauer <bjoern.brauer@new-work.se>
* ci: bump Go version & move it to env
* go.mod: bump golang.org/x/term
* ci: capture Windows arm64 binary
Co-authored-by: Casey Lee <cplee@nektos.com>
* refactor: remove `gotest.tools`
* remove all references to `gotest.tools` and replace it with
`github.com/stretchr/testify` which was originally used for tests
* bump `golangci-lint` version
* add `depguard` and `importas` to prevent import of unwanted packages
* add custom schema and information about config since
schemastore.org has broken schema for `golangci-lint` config
* fix: handle more error cases
* refactor: move survey/cfgs into own funcs, read XDG base dirs for config
Moved actrc locations to own func since it can be reused.
Moved survey part to own func due to high cyclomatic complexity.
Added XDG config dir to config locations.
Replaced using HOME envvar with go-homedir module since it's already
an indirect dependency and handles home directories better
for each GOOS.
* refactor: use `go-homedir`, check if XDG var is not empty
* Comment for public function
* Add git describe fallback
* spelling: github
* Set initial branch to satisfy tests for modern git
* Clarify -even- if
* Go 1.16
* Support running commands in repositories without action.yaml
Support runnings commands with only a Docker file
Co-authored-by: Casey Lee <cplee@nektos.com>
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
* 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>
* Add survey during first run for a default image
* few minor formatting updates
* Use image from DockerHub
Co-authored-by: Casey Lee <cplee@nektos.com>
* 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
* Test more if env variants
* The correct negation syntax is !=
* Make the Interpolate function support negated booleans from envs
* Move assert := a.New(t) into t.Run
This uncovered that some of the test premisses was wrong and the
Eval Bool function also had flaws
* Remove a stray logrus import