forgejo-runner-act/pkg/runner/testdata
Markus Wolf e360811570
refactor: remove composite action runcontext workaround (#1085)
* refactor: remove composite action runcontext workaround

The RunContext is cloned to execute a composite action with all its
steps in a similar context. This required some workaround, since
the command handler has kept a reference to the original RunContext.

This is solved now, by replacing the docker LogWriter with a proper
scoped LogWriter.

This prepares for a simpler setup of composite actions to be able
to create and re-create the composite RunContext for pre/main/post
action steps.

* test: check env-vars for local js and docker actions

* test: test remote docker and js actions

* fix: merge github context into env when read and setup

* refacotr: simplify composite context setup

* test: use a map matcher to test input setup

* fix: restore composite log output

Since we create a new line writer, we need to log the raw_output as well.
Otherwise no output will be available from the log-writer

* fix: add RunContext JobName to fill GITHUB_JOBNAME

* test: use nektos/act-test-actions

* fix: allow masking values in composite actions

To allow masking of values from composite actions, we need
to use a custom job logger with a reference to the masked
values for the composite run context.

* refactor: keep existing logger for composite actions

To not introduce another new logger while still be able to use
the masking from the composite action, we add the masks to
the go context. To leverage that context, we also add the context
to the log entries where the valueMasker then could get the actual
mask values.

With this way to 'inject' the masked values into the logger, we do
- keep the logger
- keep the coloring
- stay away from inconsistencies due to parallel jobs

* fix: re-add removed color increase

This one should have never removed :-)

* fix: add missing ExtraPath attribute

* fix: merge run context env into composite run context env

This adds a test and fix for the parent environment. It should be
inherited by the composite environment.

* test: add missing test case

* fix: store github token next to secrets

We must not expose the secrets to composite actions, but the
`github.token` is available inside composite actions.
To provide this we store the token in the config and create it in
the GithubContext from there.

The token can be used with `github.token` but is not available as
`secrets.GITHUB_TOKEN`.

This implements the same behavior as on GitHub.

Co-authored-by: Björn Brauer <bjoern.brauer@new-work.se>
Co-authored-by: Marcus Noll <markus.noll@new-work.se>

* fixup! fix: allow masking values in composite actions

* style: use tabs instead of spaces to fix linter errors

Co-authored-by: Björn Brauer <bjoern.brauer@new-work.se>
Co-authored-by: Marcus Noll <markus.noll@new-work.se>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-05-11 19:06:05 +00:00
..
act-composite-env-test refactor: remove composite action runcontext workaround (#1085) 2022-05-11 19:06:05 +00:00
actions fix: set composite outputs on failure (#945) 2022-01-21 08:08:30 -08:00
actions-environment-and-context-tests refactor: remove composite action runcontext workaround (#1085) 2022-05-11 19:06:05 +00:00
basic feat: add node16 support (#922) 2021-12-22 19:34:18 +00:00
checkout Hotfix: Skip Checkout Regression (#680) 2021-05-10 15:12:57 +00:00
commands Update images, fix extrapath (#723) 2021-06-10 23:12:05 +00:00
composite-fail-with-output fix: set composite outputs on failure (#945) 2022-01-21 08:08:30 -08:00
container-hostname feat: add node16 support (#922) 2021-12-22 19:34:18 +00:00
defaults-run Support setting shell via defaults.run (#343) 2020-08-28 11:52:25 -07:00
dir with spaces Add proper support for working-directory & fix command builder (#772) 2021-08-10 19:40:20 +00:00
env-and-path Fix regex for GITHUB_ENV parsing (#893) 2021-11-19 17:36:50 +00:00
evalmatrix fix: deep evaluate matrix strategy (#964) 2022-02-15 16:35:02 +00:00
evalmatrix-merge-array fix: deep evaluate matrix strategy (#964) 2022-02-15 16:35:02 +00:00
evalmatrix-merge-map fix: deep evaluate matrix strategy (#964) 2022-02-15 16:35:02 +00:00
evalmatrixneeds fix: deep evaluate matrix strategy (#964) 2022-02-15 16:35:02 +00:00
evalmatrixneeds2 fix: deep evaluate matrix strategy (#964) 2022-02-15 16:35:02 +00:00
fail feat: add node16 support (#922) 2021-12-22 19:34:18 +00:00
if-env-act Test: env.ACT in if condition of the workflow (#965) 2022-01-25 09:27:27 -08:00
if-expressions fix: continue jobs + steps after failure (#840) 2021-12-08 20:57:42 +00:00
issue-104 fix #127 - force eval as a boolean (#131) 2020-03-06 11:30:39 -08:00
issue-122 fix #122 - support actions/checkout for repos other the one for this workflow (#143) 2020-03-09 17:45:42 -07:00
issue-141 fix #141 - use host network to match GitHub Actions runners (#142) 2020-03-09 17:43:24 -07:00
issue-228 remove .gitignore before docker cp (#288) 2020-06-23 11:57:24 -07:00
issue-597 Expression evaluator fixes (#1009) 2022-02-25 18:39:50 +00:00
issue-598 Fixes #598 (#628) 2021-05-05 13:04:03 -07:00
job-container feat: add node16 support (#922) 2021-12-22 19:34:18 +00:00
job-container-non-root Update images, fix extrapath (#723) 2021-06-10 23:12:05 +00:00
job-status-check fix: continue jobs + steps after failure (#840) 2021-12-08 20:57:42 +00:00
local-action-docker-url Refactor local, composite actions and run steps (#712) 2021-06-10 15:28:23 +00:00
local-action-dockerfile Feature: uses in composite (#793) 2021-12-22 19:19:50 +00:00
local-action-js feat: add node16 support (#922) 2021-12-22 19:34:18 +00:00
local-action-via-composite-dockerfile Feature: uses in composite (#793) 2021-12-22 19:19:50 +00:00
localdockerimagetest_ Fix docker: invalid reference format (#767) 2021-08-09 18:16:31 +00:00
mask-values refactor: remove composite action runcontext workaround (#1085) 2022-05-11 19:06:05 +00:00
matrix fix #108 - ensure container names are unique for matrix runs 2020-03-04 16:24:14 -08:00
matrix-include-exclude Fixes include when using matrix and strategy build. (#415) 2020-12-08 10:13:07 -08:00
node fix: #170 add RUNNER_TEMP 2020-04-23 08:18:36 -07:00
non-existent-action Fix: regression run after failure (#971) 2022-01-27 16:20:44 +00:00
outputs Don't interpolate joboutputs, before job is done (#894) 2021-11-24 15:49:08 +00:00
parallel feat: add node16 support (#922) 2021-12-22 19:34:18 +00:00
pull-request fix #134 - include base_ref and head_ref in github context from the event json 2020-03-06 14:17:57 -08:00
python fix #100 - change RUNNER_TOOL_CACHE to /opt/hostedtoolcache (#103) 2020-02-25 08:52:04 -08:00
remote-action-docker fix(test): adapt to sjw change 2020-07-20 21:43:36 +02:00
remote-action-js actions/hello-world-javascript-action@master moved to main, use stable tag (#326) 2020-08-01 19:05:25 -07:00
runs-on Add support for runs-on array form (closes #146) (#155) 2020-03-16 14:58:10 -07:00
secrets feat: load every environment from --env-file to workflow (#184) 2020-04-17 10:04:40 -07:00
shells feat: add node16 support (#922) 2021-12-22 19:34:18 +00:00
steps-context Add more steps context support (#887) 2021-11-27 17:55:26 +00:00
uses-and-run-in-one-step fix: return error if both run:/uses: keys are used (#593) 2021-04-01 11:36:41 -07:00
uses-composite Expression evaluator fixes (#1009) 2022-02-25 18:39:50 +00:00
uses-composite-with-error Feature: uses in composite (#793) 2021-12-22 19:19:50 +00:00
uses-docker-url fix: don't overwrite with empty cmd/entrypoint (#1076) 2022-03-29 18:00:52 +00:00
uses-github-empty Throw an error if the steps has a invalid uses directive (#500) 2021-01-23 08:07:28 -08:00
uses-github-full-sha refactor: return more errors, add more tests (#679) 2021-05-08 03:29:03 +00:00
uses-github-noref Throw an error if the steps has a invalid uses directive (#500) 2021-01-23 08:07:28 -08:00
uses-github-path Throw an error if the steps has a invalid uses directive (#500) 2021-01-23 08:07:28 -08:00
uses-github-root Throw an error if the steps has a invalid uses directive (#500) 2021-01-23 08:07:28 -08:00
uses-github-short-sha refactor: return more errors, add more tests (#679) 2021-05-08 03:29:03 +00:00
uses-nested-composite Feature: uses in composite (#793) 2021-12-22 19:19:50 +00:00
uses-workflow fix: return error on reusable workflows (#1093) 2022-03-30 17:20:45 +00:00
workdir Add proper support for working-directory & fix command builder (#772) 2021-08-10 19:40:20 +00:00