refactor: remove composite action runcontext workaround#1085
refactor: remove composite action runcontext workaround#1085mergify[bot] merged 19 commits intomasterfrom
Conversation
MegaLinter status: ✅ SUCCESS
See errors details in artifact MegaLinter reports on CI Job page |
ea70f9b to
5883f7e
Compare
|
Ops, this has to wait for #1083 |
Codecov Report
@@ Coverage Diff @@
## master #1085 +/- ##
==========================================
+ Coverage 57.50% 60.04% +2.53%
==========================================
Files 32 39 +7
Lines 4594 4990 +396
==========================================
+ Hits 2642 2996 +354
- Misses 1729 1746 +17
- Partials 223 248 +25
📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more |
|
We need more tests for nodejs and docker actions before this PR can be merged, or we see heavy regressions.
I only have added tests for GITHUB_ACTION_PATH in composite actions, which seem to be still working if I can trust my tests. |
|
I will add tests tomorrow |
5883f7e to
3017fa4
Compare
|
According to the docs the I'll add tests for |
|
Ok, |
|
I will add tests for |
2940e0c to
02628aa
Compare
|
@nektos/act-maintainers I'd consider this refactoring fine now. It already fixes regressions related to the env-var in actions. |
ChristopherHX
left a comment
There was a problem hiding this comment.
Hmm I have no idea why I don't see any log output of run steps inside composite actions.
Due to this I couldn't test if ::add-mask:: is still working.
|
I have issues with This make me think we need tests which tests secret masking. |
|
Right. I will add a test for that tomorrow |
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
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.
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
This one should have never removed :-)
This adds a test and fix for the parent environment. It should be inherited by the composite environment.
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>
04822f8 to
fd76d7e
Compare
|
@KnisterPeter this pull request has failed checks 🛠 |
fd76d7e to
b1220cd
Compare
|
@KnisterPeter this pull request has failed checks 🛠 |
|
@cplee This is waiting for a review/merge. |
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.