Commit Graph

656 Commits

Author SHA1 Message Date
Josh Soref 5752a03dcd
Support running commands in repositories without action.yaml (#293)
* 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>
2021-03-30 12:26:25 -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
Casey Lee 737dfaff3d
Merge branch 'master' of github.com:nektos/act 2021-03-29 10:22:50 -07:00
Casey Lee aaaa89532a
Update CODEOWNERS to use 'act-maintainers' team 2021-03-29 10:22:33 -07:00
Justin Grote 957b8ad76d
Update Shell Tasks to match ScriptHandlerHelpers (#575)
* Update Shell Tasks to match ScriptHandlerHelpers
Code: https://github.com/actions/runner/blob/main/src/Runner.Worker/Handlers/ScriptHandlerHelpers.cs

Docs: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#using-a-specific-shell

Fixes #467

* 🩹 Remove old ps1 handler

* ♻️ gocritix fix

* 🐛 Powershell command must be a single entry to docker API
Fixes #467

* Remove Act Temp

* Remove additional Act Directories

* remove hard-coded workdir

Co-authored-by: Casey Lee <cplee@nektos.com>
2021-03-29 10:06:51 -07:00
Casey Lee c27ef0a65c
update to codecov version 2021-03-29 09:07:13 -07:00
hackercat 780a8a061c
fix: use new platforms after survey, check working dir for `.actrc` (#577) 2021-03-29 07:58:00 -07:00
hackercat f5a02581c2
Add code testing on MacOS (#563)
* feat: add code testing on macos

* change name of test job

Keep the test job named `test` to align with current branch protection checks

Co-authored-by: Casey Lee <cplee@nektos.com>
2021-03-29 07:55:51 -07:00
Casey Lee af5140f13e
Merge branch 'master' of github.com:nektos/act 2021-03-28 22:34:03 -07:00
Casey Lee 345c652e75
add status checks 2021-03-28 22:28:45 -07:00
Casey Lee 2825449c7f
add codecov integration (#585)
* add codecov integration

* include past tags when releasing
2021-03-28 22:15:56 -07:00
Casey Lee 69018f36d3
include past tags when releasing 2021-03-28 22:11:42 -07:00
Casey Lee f58fbc0dff
add codecov integration 2021-03-28 22:02:11 -07:00
hackercat 72f2d2de51
fix: update `ubuntu-latest` to point to `ubuntu-20.04` (#580)
GitHub Actions switched `ubuntu-latest` to `ubuntu-20.04`
Ref:
  https://github.com/actions/virtual-environments/issues/1816
  https://github.com/actions/virtual-environments/pull/2852
2021-03-28 21:47:07 -07:00
hackercat 29b3d43988
fix: hardcode `ubuntu-latest` for `ImageOS` envvar (#579)
Hardcode current `ubuntu-latest` since we have no way to check that 'on the fly'
2021-03-28 21:46:09 -07:00
hackercat f3b53d8eca
fix: pass `sc.Env` through `common.Logger` to hide secrets (#578)
Currently all secrets are exposed when running with `--verbose`/`-v` option
2021-03-28 21:45:07 -07:00
Justin Grote da07324779
CI: Add snapshot artifacts to PR builds (#574)
* Feat: Add snapshot artifacts to PR builds

* Separate Artifacts to keep file size down

* Name the tasks
2021-03-28 21:38:28 -07:00
hackercat b438b836ea
fix: invoke login shells to source `/etc/environment` (#570) 2021-03-28 21:35:01 -07:00
rockandska 6cde8f64dc
use project dir instead of /github/workspace (#567) 2021-03-28 21:32:45 -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
hackercat 41b03b581c
fix: add `ImageOS` env var based on running platform (#571) 2021-03-17 17:14:08 -07:00
hackercat 09679f0156
Update test workflows and improve `expression_test.go`/`run_context_test.go` (#560)
* fix: give case insensitive secret more meanigful name

* refactor: use `string` in generating `env:` and `steps:` for workflows

Smaller text generation is much better to read with normal strings than
raw string literals.

* feat: sort keys for `env:` so it's always in specific order

* fix: update test workflows
2021-03-12 16:25:10 -08:00
hackercat eb2774275f
Fix tests on Windows (#562)
* fix: replace `\` with `/` in git ref to fix `git_test.go` on windows

Paths on Windows use backslash (`\`) as directory separator and this breaks `TestGitFindRef()`.
Replacing `\` with `/` in git ref fixes that issue.

* fix: replace `gopkg.in/godo.v2/glob` with std library `path/filepath`

`github.com/go-godo/godo` lib has been last updated in 2016 and it also
depends on another outdated lib `github.com/MichaelTJones/walk` with
last update in 2016. This also fixes `permission_denied` errors on
Windows (and perhaps Linux in some specific cases). I'm not aware of
any performance improvement or drawback because of that change.
2021-03-12 16:23:03 -08:00
Alfredo Deza f29b1f2523
Add more context to MODULE_NOT_FOUND errors and how to fix it (#552) 2021-03-12 16:15:27 -08: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
Horimatsu Takuya 6c118fe9ad
#534 feat: step continues when continue-on-error is ture (#544)
* feat: step continues when continue-on-error is ture

* fix: typo, logging and make bool continuable

Co-authored-by: Casey Lee <cplee@nektos.com>
2021-02-25 08:55:07 -08:00
Shin Uozumi 14c06ee5e4
enable to resolve commit hash in `uses` (#530)
Co-authored-by: sinozu <sinozu@users.noreply.github.com>
Co-authored-by: Casey Lee <cplee@nektos.com>
2021-02-23 09:50:28 -08:00
hackercat 34dc2dc15c
Update Docker images (#524) 2021-02-23 09:49:24 -08:00
Kamil Domański 475a6aa1d0
properly parse arguments to Docker container steps (#539) 2021-02-23 09:47:06 -08:00
Johannes Nicolai c4f1f3a1cf
Fix link to issue #97 in README.md (#541)
* fix link to issue #97 in README.md explaining why certain runner platforms are not supported
2021-02-23 09:45:28 -08:00
Shin Uozumi 9bf37fb868
Fix indent with go fmt (#531)
Co-authored-by: sinozu <sinozu@users.noreply.github.com>
2021-02-17 11:47:59 -08:00
Andrew Gee 60669808a4
Removed pipefail from bash shell execution to match GitHub Actions (#529)
fixes #528

Co-authored-by: Hugh Lunt <hugh.lunt@itv.com>

Co-authored-by: Hugh Lunt <hugh.lunt@itv.com>
2021-02-12 08:28:26 -08:00
Cat™ 661aa08235
Add GitHub issue templates (#512) 2021-02-08 09:15:51 -08:00
KADOTA, Kyohei 316b078f8c
Shouldn't rewrite dot in a string to index syntax (#502)
Co-authored-by: Casey Lee <cplee@nektos.com>
2021-02-08 09:14:12 -08:00
Cat™ fc46f506e3
Update `README.md`/`cmd/root.go` with additional information (#523)
* Update README

* Add notice about large image, add link to repo for `.actrc`
2021-02-08 09:12:57 -08:00
Cat™ ec6b1624c0
Fix choco Dockerfile (#515) 2021-02-03 11:12:15 -08:00
Taiju Muto eca1b9c478
Add lacking environment variables. (#513) 2021-01-31 21:59:51 -08:00
Cat™ 8339f4b404
Interpolate `with:` inputs (#511) 2021-01-30 17:43:11 -08:00
Owen Young 22d56c3517
fix: --version, --help do not need check platform config (#508) 2021-01-29 06:40:13 -08:00
Ed 56ec36726b
Fix Cartesian product to return empty set if empty set is given (#503)
This fixes #499, where a matrix strategy with only include keys ends up
causing multiple builds.  This bugs appears to have been introduced in #415,
when extra include keys are added in the matrix strategy.  The cause
seems to be because the CartesianProduct function returns an item with
empty keys, instead of return an empty set.

Co-authored-by: Ed Tan <edtan@users.noreply.github.com>
2021-01-23 14:55:54 -08:00
KADOTA, Kyohei 2d1a946fb1
Throw an error if the steps has a invalid uses directive (#500)
* Throw an error if the steps has a invalid uses directive

* Refactor TestStepContextExecutor
2021-01-23 08:07:28 -08:00
Cat™ e37b42a333
Print error with workflow/job information when runs-on key is not defined (#494)
Co-authored-by: Casey Lee <cplee@nektos.com>
2021-01-21 06:02:48 -08:00
KADOTA, Kyohei 719a077b7c
Stop current execution if there is the invalid syntax in the workflow (#495) 2021-01-21 06:00:33 -08:00
Cat™ b424a785e3
Load .secrets file as default (#488)
* Load .secrets file as default

* Update README
2021-01-19 06:31:46 -08:00
Cat™ 6130460c40
Add survey during first run for a default image (#483)
* 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>
2021-01-19 06:30:17 -08:00
Ed c7b3869b2f
Report error when `if` expression is invalid (#485)
Co-authored-by: Ed Tan <edtan@users.noreply.github.com>
Co-authored-by: Casey Lee <cplee@nektos.com>
2021-01-18 11:44:27 -08:00
Cat™ 9bbf35e88e
Add autodetect event flag (#486)
* Add autodetect event flag

* Add new flag to README.md

* Make help more clear
2021-01-18 11:42:55 -08:00
Casey Lee 7f6a808262
update stale labels to stop closing issues that are NOT stale 2021-01-18 10:41:49 -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™ 41692c314d
Add --env flag to pass environment vars without file (#474) 2021-01-14 21:26:01 -08:00