Commit Graph
7 Commits
Author SHA1 Message Date
edd0fb92a7 feat: try to read ref and sha from event payload if available (#889)
With this change `act` will try to populate the `githubContext.ref` and
`githubContext.sha` with values read from the event payload.

Caveats:
- `page_build` should not have a ref
- `status` should not have a ref
- `registry_package` should set the ref to the branch/tag but the
  payload isn't documented
- `workflow_call` should set ref to the same value as its caller but the
  payload isn't documented
- most of the events should set the sha to the last commit on the ref
  but unfortunately the sha is not always included in the payload,
  therefore we use the sha from the local git checkout

Co-Authored-By: Philipp Hinrichsen <[email protected]>

Co-authored-by: Philipp Hinrichsen <[email protected]>
2022-01-21 08:10:00 -08:00
eba71f98fe Refactor expression evaluator to use parser from actionlint package (#908)
* feat: implement expression evaluator

Co-authored-by: Markus Wolf <[email protected]>
Co-authored-by: Philipp Hinrichsen <[email protected]>

* feat: integrate exprparser into act

Co-authored-by: Markus Wolf <[email protected]>
Co-authored-by: Philipp Hinrichsen <[email protected]>

* Escape { and }, do not fail on missing properties

* Fix empty inputs context

* fix: contains() comparison for complex values

Co-authored-by: Markus Wolf <[email protected]>
Co-authored-by: Philipp Hinrichsen <[email protected]>
Co-authored-by: Christopher Homberger <[email protected]>
2022-01-21 08:07:20 -08:00
Björn BrauerGitHubMarkus Wolfmergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
ed01f464ed refactor: export and move shared contexts into pkg/model (#931)
This commit moves the githubContext, jobContext and stepResult structs
from the runner package to the model package in preparation for #908
because the expression.go file lives in the runner package and would
introduce cyclic dependencies with the exprparser package.

Co-authored-by: Markus Wolf <[email protected]>

Co-authored-by: Markus Wolf <[email protected]>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-12-22 19:52:09 +00:00
Björn BrauerandGitHub fec0c0c529 fix: ::stop-commands:: should continue to print the lines (#920)
> This special command allows you to log anything without accidentally running a workflow command.
https://docs.github.com/en/actions/learn-github-actions/workflow-commands-for-github-actions#stopping-and-starting-workflow-commands

Example: https://github.com/ZauberNerd/act-test/runs/4469496818?check_suite_focus=true#step:8:10
2021-12-09 15:10:56 +00:00
b910a42edf Docker auth (#891)
* feat: read docker credentials from local docker config

* fix: url.Parse requires protocol

Co-authored-by: Björn Brauer <[email protected]>

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

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

Co-authored-by: Björn Brauer <[email protected]>

* 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 <[email protected]>

Co-authored-by: Markus Wolf <[email protected]>
2021-11-27 18:21:32 +00:00
6517d04b9a feat: allow existing logger from context (#898)
We should reuse an existing context logger if in test context.
This will allow test to setup act with a null logger to assert
log messages.

Co-authored-by: Markus Wolf <[email protected]>

Co-authored-by: Markus Wolf <[email protected]>
2021-11-27 17:45:56 +00:00
0c4374ec41 GitHub Enterprise support (#658)
* Add option to specify custom GitHub instance

* Use correct GHE API endpoint URLs

Co-authored-by: Markus Wolf <[email protected]>

* Extract slug from GitHub Enterprise URLs

Co-authored-by: Markus Wolf <[email protected]>

* Use GITHUB_TOKEN for clone authenticate if provided

This change will allow use authentication for cloning actions
from private repositories or github enterprise instances.

Co-Authored-By: Markus Wolf <[email protected]>

* Add section about using act on GitHub Enterprise to README

Co-authored-by: Markus Wolf <[email protected]>

* Set GitHubInstance in runnerConfig in runner_test

Co-authored-by: Markus Wolf <[email protected]>

Co-authored-by: hackercat <[email protected]>
Co-authored-by: Markus Wolf <[email protected]>
2021-05-05 09:42:34 -07:00