Commit graph

152 commits

Author SHA1 Message Date
Björn Brauer
eba71f98fe
Refactor expression evaluator to use parser from actionlint package (#908)
* 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>
2022-01-21 08:07:20 -08:00
Björn Brauer
b910a42edf
Docker auth (#891)
* feat: read docker credentials from local docker config

* fix: url.Parse requires protocol

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

* fix: docker decides by the existence of . or : if...

... the image is in a custom registry or not.

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

* fix: make docker hostname detection more robust

* test: mock docker config for getImagePullOptions test

By default github actions have a docker config set with a token to pull
images from docker hub.

Co-authored-by: Markus Wolf <markus.wolf@new-work.se>

Co-authored-by: Markus Wolf <markus.wolf@new-work.se>
2021-11-27 18:21:32 +00:00
Vladimir Romashchenko
f7263399b9
feat: SELinux lables for --bind (#906) 2021-11-26 05:18:31 +00:00
dependabot[bot]
c26e661889
build(deps): bump github.com/go-ini/ini from 1.63.2 to 1.64.0 (#882)
Bumps [github.com/go-ini/ini](https://github.com/go-ini/ini) from 1.63.2 to 1.64.0.
- [Release notes](https://github.com/go-ini/ini/releases)
- [Commits](https://github.com/go-ini/ini/compare/v1.63.2...v1.64.0)

---
updated-dependencies:
- dependency-name: github.com/go-ini/ini
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-11-15 14:33:01 +00:00
Markus Wolf
11f6ee37a6
Asset server implementation (#677)
* 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>
2021-11-10 09:57:22 -08:00
dependabot[bot]
f8b3563102
build(deps): bump github.com/moby/buildkit from 0.9.1 to 0.9.2 (#864)
Bumps [github.com/moby/buildkit](https://github.com/moby/buildkit) from 0.9.1 to 0.9.2.
- [Release notes](https://github.com/moby/buildkit/releases)
- [Commits](https://github.com/moby/buildkit/compare/v0.9.1...v0.9.2)

---
updated-dependencies:
- dependency-name: github.com/moby/buildkit
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-10 09:54:38 -08:00
dependabot[bot]
6a3a47c217
build(deps): bump github.com/docker/docker (#855)
Bumps [github.com/docker/docker](https://github.com/docker/docker) from 20.10.8+incompatible to 20.10.10+incompatible.
- [Release notes](https://github.com/docker/docker/releases)
- [Changelog](https://github.com/moby/moby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/docker/docker/compare/v20.10.8...v20.10.10)

---
updated-dependencies:
- dependency-name: github.com/docker/docker
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-01 01:38:50 +00:00
dependabot[bot]
50dd0c0db1
build(deps): bump github.com/docker/cli (#854)
Bumps [github.com/docker/cli](https://github.com/docker/cli) from 20.10.8+incompatible to 20.10.10+incompatible.
- [Release notes](https://github.com/docker/cli/releases)
- [Commits](https://github.com/docker/cli/compare/v20.10.8...v20.10.10)

---
updated-dependencies:
- dependency-name: github.com/docker/cli
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Casey Lee <cplee@nektos.com>
2021-10-31 16:20:06 +00:00
dependabot[bot]
b5e8a18683
build(deps): bump github.com/moby/buildkit from 0.9.0 to 0.9.1 (#838)
Bumps [github.com/moby/buildkit](https://github.com/moby/buildkit) from 0.9.0 to 0.9.1.
- [Release notes](https://github.com/moby/buildkit/releases)
- [Commits](https://github.com/moby/buildkit/compare/v0.9.0...v0.9.1)

---
updated-dependencies:
- dependency-name: github.com/moby/buildkit
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-18 20:24:05 +00:00
dependabot[bot]
bfcf0abd73
build(deps): bump github.com/joho/godotenv from 1.3.0 to 1.4.0 (#824)
Bumps [github.com/joho/godotenv](https://github.com/joho/godotenv) from 1.3.0 to 1.4.0.
- [Release notes](https://github.com/joho/godotenv/releases)
- [Commits](https://github.com/joho/godotenv/compare/v1.3.0...v1.4.0)

---
updated-dependencies:
- dependency-name: github.com/joho/godotenv
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Casey Lee <cplee@nektos.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-09-26 16:47:33 +00:00
Ryan
5a09eb24ca
Bump all dependencies (and fix dependabot mess) (#822)
* build(deps): bump all Go deps

* build(deps): bump actions/setup-go & actions/stale
2021-09-25 12:13:22 -07:00
dependabot[bot]
6d7f574859
build(deps): bump github.com/go-git/go-billy/v5 from 5.0.0 to 5.3.1 (#802)
Bumps [github.com/go-git/go-billy/v5](https://github.com/go-git/go-billy) from 5.0.0 to 5.3.1.
- [Release notes](https://github.com/go-git/go-billy/releases)
- [Commits](https://github.com/go-git/go-billy/compare/v5.0.0...v5.3.1)

---
updated-dependencies:
- dependency-name: github.com/go-git/go-billy/v5
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-09-10 15:34:10 +00:00
Marcin Falkowski
9126f15aa2
support for container option: --hostname (#809) 2021-09-10 05:03:40 +00:00
dependabot[bot]
a7a2659c0e
build(deps): bump github.com/AlecAivazis/survey/v2 from 2.2.7 to 2.3.1 (#803)
Bumps [github.com/AlecAivazis/survey/v2](https://github.com/AlecAivazis/survey) from 2.2.7 to 2.3.1.
- [Release notes](https://github.com/AlecAivazis/survey/releases)
- [Commits](https://github.com/AlecAivazis/survey/compare/v2.2.7...v2.3.1)

---
updated-dependencies:
- dependency-name: github.com/AlecAivazis/survey/v2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-08 14:52:34 +00:00
Ryan
4c645b3ed9
Update Go to 1.17 (#787)
* 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>
2021-08-30 11:06:20 -07:00
Ryan (hackercat)
a6a865e973
fix: replace gopass lib with golang.org/x/term (#674)
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-05-06 20:13:14 +00:00
hackercat
4125812a63
Refactor .actrc locations and default image survey (#600)
* 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
2021-04-05 08:51: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
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
KADOTA, Kyohei
6e1cdeefc0
Fix "reference not found" error on checkout (#433) (#471) 2021-01-14 21:24:17 -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
Yoan Blanc
3eef111e46
chore: upgrade docker v19.03.12 (#348)
Signed-off-by: Yoan Blanc <yoan@dosimple.ch>
2020-08-29 22:55:22 -07:00
Casey Lee
85f89e16eb
fix docker build issue on windows 2020-08-28 12:31:16 -07:00
Yoan Blanc
b3b8961122
feat: docker 19.03.12 (#347)
Signed-off-by: Yoan Blanc <yoan@dosimple.ch>
2020-08-28 11:45:03 -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
Máximo Cuadros
f6e37a8d67
*: update go-git import (#194) 2020-04-16 16:24:30 -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
bd6f232b20
fix build for windows 2020-03-06 17:08:07 -08:00
chenrui
ca648a37c8
chore(deps): cleanup go.mod a little bit (#136)
* Upgrade docker to v19.03.7

* go mod vendor

* golangci-lint 1.23.8
2020-03-06 14:37:54 -08:00
Casey Lee
4fde7d8865
fix #121 and #123 - add support for reading env variables from .env (#133) 2020-03-06 12:30:24 -08:00
Casey Lee
1f9f3b826e
go mod tidy 2020-03-06 09:11:18 -08:00
Casey Lee
1d84ee0db1
fix #102 - add windows support 2020-02-25 09:22:59 -08:00
Casey Lee
01876438c2
shared container for job 2020-02-23 15:01:25 -08:00
Casey Lee
573f78e1b4
support for secrets
Signed-off-by: Casey Lee <cplee@nektos.com>
2020-02-20 21:06:09 -05:00
Casey Lee
e40ab0145f
expressions working
Signed-off-by: Casey Lee <cplee@nektos.com>
2020-02-20 21:05:55 -05:00
Casey Lee
64562d41ab
test updates
Signed-off-by: Casey Lee <cplee@nektos.com>
2020-02-20 21:05:44 -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
ac8258db4b
support list/map/scalar for on and needs
Signed-off-by: Casey Lee <cplee@nektos.com>
2020-02-20 21:05:34 -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
be75ee20b1
local actions
Signed-off-by: Casey Lee <cplee@nektos.com>
2020-02-20 21:05:29 -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
Jesse Newland
3198627879 --watch 2019-02-09 20:39:09 -06:00
Casey Lee
4b61fb3bc3
pin to v1.0.0 of github action parser 2019-02-06 22:36:16 -08:00
Casey Lee
3e04312912
update to latest version of action parser 2019-02-06 22:36:15 -08:00
Casey Lee
5d0a8d26ae
replace parser with actions/workflow-parser 2019-02-06 22:36:13 -08:00
Casey Lee
8793c8a6a4
add support for 'reuse' mode to allow act to be used for a fast local task runner 2019-01-17 14:53:35 -08:00
Casey Lee
317a305f51
refactor actions to improve testability 2019-01-17 14:53:35 -08:00
Casey Lee
c573d9d48a
fix #7 - allow passing a custom event.json to be populated in the container filesystem 2019-01-16 13:11:32 -08:00
Casey Lee
88847aed71
add unit tests for various ways an action can be defined 2019-01-15 23:11:45 -08:00
Casey Lee
f683af5954
Initial commit with support for GitHub actions 2019-01-12 20:45:25 -08:00