Commit Graph
74 Commits
Author SHA1 Message Date
f8ddfca6f7 goreleaser: Switch to latest and drop Homebrew config (#848)
* ci: unpin goreleaser version

homebrew issue has been fixed

* ci: drop homebrew from goreleaser

act has been for quite a long time in homebrew-core
and it supports all macos/linux so there is no
reason for us to have separate tap, as it might
confuse some users

Co-authored-by: Casey Lee <[email protected]>
2021-10-24 09:36:09 -07:00
RyanandGitHub 977b526384 ci: switch macos job to macos-10.15 (#849) 2021-10-23 18:37:33 -07:00
RyanandGitHub a0d360236e fix: rewrite StepContext env (#832)
* fix: rewrite StepContext env

step env from workflow should be last one to be written
fixes https://github.com/nektos/act/issues/777

* test: verify env correctness

* fix: move test into existing workflow
2021-09-28 01:18:59 +00:00
RyanandGitHub 6c60af7677 fix: rewrite how image env is merged (#828)
* fix: rewrite how image env is merged

* test: add test for extractFromImageEnv
2021-09-27 19:01:14 +00:00
RyanandGitHub 7a426a0f37 refactor: re-implement embed without "unused" import (#830)
* refactor: re-implement `embed` without "unused" import

* fix(gitignore): ignore local docker registry data
2021-09-27 17:33:14 +00:00
RyanGitHubmergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
c2c8b525f8 Add reading environment from Docker image (#771)
* fix: read envvars from image definition

* fix: add test

* fix: sort slices

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-09-26 16:37:53 +00:00
4d552e65ce fix: add simple concurrency limit (#823)
Co-authored-by: Casey Lee <[email protected]>
2021-09-26 16:21:12 +00:00
RyanandGitHub b1e4844aac ci: pin goreleaser version (#825) 2021-09-26 09:05:43 -07:00
RyanandGitHub 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
RyanGitHubmergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
3c1454825d fix: mount volume for workflow info (#776)
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-09-24 13:32:22 +00:00
RyanandGitHub 17652ce80e Remove ubuntu-16.04 and add missing links for nix/go (#821)
* fix: remove ubuntu-16.04

* fix: add missing links for nix/go

* fix: remove specific platform versions
2021-09-22 19:43:58 +00:00
RyanandGitHub 12928a0ac6 feat: add Dependabot config (#797)
Add Dependabot to keep dependencies up to date
2021-09-08 13:46:45 +00:00
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 <[email protected]>
2021-08-30 11:06:20 -07:00
RyanandGitHub 37aaec81f4 feat: improve list (#786) 2021-08-30 15:38:03 +00:00
RyanandGitHub de44a505da fix: copy whole action dir to container (#774)
fixes https://github.com/nektos/act/issues/754
this will prevent actions from failing that use resources outside
of the action directory
2021-08-10 22:21:52 -07:00
RyanandGitHub bea32d5651 Add proper support for working-directory & fix command builder (#772)
* fix: align other Docker executors to print action

* fix: formatting

* fix: add proper workdir support

* fix: replace script filepath after slice creation

* fix: match substring so it works for pwsh

+ rename containerPath to scriptPath to reflect what value it contains
2021-08-10 19:40:20 +00:00
RyanandGitHub 5c841e22ab Update docs, file formatting and docker images (#766)
* docs: fix wrong licence link

* fix: add more formatting settings, reformat all

feat: add vscode extensions recommendations

* docs: update contributing documentation

* fix: remove unnecessary comment

it was due to broken checkout

* docs: rework installation section

it has been brought up few times, new style should be easier
to understand

* docs: update images provided by catthehacker

* docs: replace 18.04 with recent image

* fix: add final new line
2021-08-09 09:07:26 -07:00
RyanGitHubmergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
94fd0ac899 Simplify Matrix decode, add defaults for fail-fast and max-parallel, add test (#763)
* fix[workflow]: multiple fixes for workflow/matrix

fix[workflow]: default `max-parallel`
fix[workflow]: default `fail-fast`, it's `true`, not `false`
fix[workflow]: skipping over the job when `strategy:` is defined but `matrix:` isn't (fixes #625)
fix[workflow]: skip non-existing includes keys and hard fail on non-existing excludes keys
fix[workflow]: simplify Matrix decode (because I "think" I know how `yaml` works) (fixes #760)
fix[tests]: add test for planner and runner

* fix(workflow): use yaml node for env key

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-08-09 15:35:05 +00:00
Ryan (hackercat)andGitHub 1cf422e411 fix: warn Apple M1 (arm64) users (#743)
* fix: warn Apple M1 (arm64) users

* fix: missing dep

* fix: linting

* fix: linting (again)
2021-06-23 18:09:27 +00:00
a9fe038347 Update images, fix extrapath (#723)
* fix: typo

* fix: remove debug for git references

it generates a massive amount of logs

* feat: read values from env

allows to test act on GHA when it's not a main repo

* fix: merge extrapath with PATH

* fix(tests): add additional shells for testing

* fix(image): update images

pin node to major version only, current node version: 12.22.1
replace most images with `node:12-buster-slim` to prevent
errors on macOS runner due to DockerHub pull limit
replace ocaml image

Co-authored-by: Casey Lee <[email protected]>
2021-06-10 23:12:05 +00:00
Ryan (hackercat)andGitHub 2261204c65 fix: wrong perms (#726)
if someone is using image with a non-root user, they will get a permission denied since only root has write perms
2021-06-09 16:08:39 -07:00
Ryan (hackercat)andGitHub 6550eb7f25 fix: update codecov action (again) (#731) 2021-06-09 10:30:16 -07:00
Ryan (hackercat)andGitHub 05bce00e93 fix: update codecov action (#727) 2021-06-07 10:26:28 -07:00
Ryan (hackercat)andGitHub 96a0564526 fix: don't replace empty secrets (#725) 2021-06-07 13:54:12 +00:00
Ryan (hackercat)GitHubmergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
33ccfa6f3b Switch to interface{} instead of map[string]... (#700)
* fix: change `env` to be an interface

allows to use GitHub functions like `fromJson()`

* fix: change matrix to an interface instead of map

This allows to use GitHub functions like `fromJson()` to create dynamic
matrixes

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-06-06 14:53:18 +00:00
Ryan (hackercat)GitHubmergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
fa93f4d5e7 fix: update issue template (#722)
* fix: update issue template

add additional information to be provided by user that should help in troubleshooting

* fix: move markdownlint config and link it

done it so the markdownlint-cli stops shouting about issues

* feat: add Matrix link

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-06-04 20:16:01 +00:00
Ryan (hackercat)GitHubmergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
d794e2fe4c Move actions path outside of workdir (#701)
* feat: add option to specify user for exec

* fix: move actions to static path outside workdir

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-05-24 17:09:03 +00:00
Ryan (hackercat)andGitHub 490039975f Add arm64/arm and capture all snapshots (#699)
* fix: format `.goreleaser.yml`

* feat: add `arm64`/`arm` builds

* feat: capture all binaries built by goreleaser

`upload-artifact` actions will run only on GitHub Actions due to
`ACTIONS_RUNTIME_TOKEN` requirement

* fix: remove `windows/arm/6`
2021-05-23 08:32:55 -07:00
Ryan (hackercat)andGitHub 799098b0e6 feat: add option for custom socket path (#698) 2021-05-23 14:43:09 +00:00
Ryan (hackercat)andGitHub f571290b25 refactor: remove gotest.tools (#688)
* 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
2021-05-17 23:14:49 -07:00
Ryan (hackercat)andGitHub aa68181f6b refactor: return more errors, add more tests (#679)
adding more tests
returns same message for short SHA format like GitHub Actions
refactor error checking
add more errors :)
2021-05-08 03:29:03 +00:00
Ryan (hackercat)GitHubmergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
cc4e23d96c fix: remove Windows issue from README.md (#675)
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-05-06 13:16:24 -07:00
Ryan (hackercat)GitHubmergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
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
Ryan (hackercat)GitHubmergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
37a98f134a feat: add go install instruction (#672)
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-05-06 13:43:50 +00:00
Ryan (hackercat)andGitHub 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
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 <[email protected]>
2021-05-03 09:52:03 -07:00
Ryan (hackercat)andGitHub 780f60a1e6 fix: ignore act binary built when using make (#654) 2021-05-03 08:26:12 -07:00
806bc4d999 refactor: NewWorkflowPlanner (#648)
feat: add flag `--no-recurse` to disable recursion when reading workflows from directories
feat: added more tests to `TestPlanner`, renamed `TestJobFileInfo` to more appropriate name `WorkflowPlanTest`
style: changed error message to lowercase, added single quotes for better visibility

Co-authored-by: Casey Lee <[email protected]>
2021-05-03 07:57:24 -07:00
b04d762614 feat: Don't push pkg/runner/act/ where actions cache is stored (#620)
This will prevent pushing `act` cache that happens occasionally.

Co-authored-by: Casey Lee <[email protected]>
2021-05-03 07:54:51 -07:00
Ryan (hackercat)andGitHub 08141f5b00 fix: update readme with more relevant/updated information (#630) 2021-05-03 07:41:30 -07:00
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 <[email protected]>
2021-05-03 07:37:20 -07:00
Ryan (hackercat)andGitHub 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
Ryan (hackercat)andGitHub 3e768cd916 feat: Speeding up workflows (#643)
* fix: rework macOS test so it's faster

* feat: add go module caching
2021-05-02 08:13:30 -07:00
hackercatandGitHub 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
hackercatandGitHub 94d736a602 fix: fail workflow if the job name is invalid (#596) 2021-04-02 07:01:45 -07:00
hackercatandGitHub 5044ec6c43 fix: remove HOME env var (#594) 2021-04-01 14:01:01 -07:00
hackercatandGitHub 25779af4bf fix: return error if both run:/uses: keys are used (#593)
fixes https://github.com/nektos/act/issues/536
2021-04-01 11:36:41 -07:00
hackercatandGitHub 780a8a061c fix: use new platforms after survey, check working dir for .actrc (#577) 2021-03-29 07:58:00 -07:00
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 <[email protected]>
2021-03-29 07:55:51 -07:00
hackercatandGitHub 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
hackercatandGitHub 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
hackercatandGitHub 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
hackercatandGitHub b438b836ea fix: invoke login shells to source /etc/environment (#570) 2021-03-28 21:35:01 -07:00
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 <[email protected]>
2021-03-28 21:08:40 -07:00
hackercatandGitHub 41b03b581c fix: add ImageOS env var based on running platform (#571) 2021-03-17 17:14:08 -07:00
hackercatandGitHub 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
hackercatandGitHub 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
hackercatandGitHub 34dc2dc15c Update Docker images (#524) 2021-02-23 09:49:24 -08:00
Cat™andGitHub 661aa08235 Add GitHub issue templates (#512) 2021-02-08 09:15:51 -08:00
Cat™andGitHub 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™andGitHub ec6b1624c0 Fix choco Dockerfile (#515) 2021-02-03 11:12:15 -08:00
Cat™andGitHub 8339f4b404 Interpolate with: inputs (#511) 2021-01-30 17:43:11 -08:00
e37b42a333 Print error with workflow/job information when runs-on key is not defined (#494)
Co-authored-by: Casey Lee <[email protected]>
2021-01-21 06:02:48 -08:00
Cat™andGitHub b424a785e3 Load .secrets file as default (#488)
* Load .secrets file as default

* Update README
2021-01-19 06:31:46 -08:00
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 <[email protected]>
2021-01-19 06:30:17 -08:00
Cat™andGitHub 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
Cat™andGitHub 41692c314d Add --env flag to pass environment vars without file (#474) 2021-01-14 21:26:01 -08:00
Cat™andGitHub 460ed2db04 Update parts of repo (#476)
* Update flags in README

* Add secrets and `.env` files examples

* Fix typo: environment

* Fix typo: returned

* Add --version back, since I've built act without ldflags
2021-01-14 21:21:44 -08:00
Cat™andGitHub 97dc3cf147 Make stale bot action less aggressive (#478)
Make stale bot action less aggressive
Days before marking issues/PRs as stale: 30
Days before closing stale issues/PRs: 14
2021-01-14 21:19:25 -08:00
Cat™andGitHub 2811101dea Make all secrets case insensitive by formatting them to uppercase (#470)
* Uppercase secrets, print error when secret with same name already exists

* Test lower-to-upper case formatting for secrets
2021-01-12 09:54:53 -08:00
Cat™andGitHub 760daebf5d Fix slashes when running on Windows (#461) 2021-01-11 22:41:35 -08:00
Cat™andGitHub 80a245652e Add option to disable hiding of secrets (#460) 2021-01-11 22:28:45 -08:00
Cat™andGitHub a9b3d6426b Use static initial PATH (#462) 2021-01-11 22:27:16 -08:00
fecc571bce Add Ubuntu 20.04 to supported platforms (#463)
Co-authored-by: Casey Lee <[email protected]>
2021-01-11 22:22:53 -08:00