-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
implement pre and post steps #1089
Conversation
MegaLinter status: ✅ SUCCESS
See errors details in artifact MegaLinter reports on CI Job page |
Codecov Report
@@ Coverage Diff @@
## master #1089 +/- ##
==========================================
+ Coverage 57.50% 61.50% +3.99%
==========================================
Files 32 40 +8
Lines 4594 5287 +693
==========================================
+ Hits 2642 3252 +610
- Misses 1729 1781 +52
- Partials 223 254 +31
📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more |
1b54162
to
701b2c9
Compare
@nektos/act-maintainers I've added a few test to make sure our post steps run and run in order. |
pkg/runner/testdata/uses-composite-with-pre-and-post-steps/action-with-pre-and-post/main.js
Outdated
Show resolved
Hide resolved
pkg/runner/testdata/uses-composite-with-pre-and-post-steps/action-with-pre-and-post/post.js
Outdated
Show resolved
Hide resolved
@KnisterPeter this pull request is now in conflict 😩 |
bd4c230
to
dc184ca
Compare
a711610
to
2d06b71
Compare
@KnisterPeter this pull request is now in conflict 😩 |
dc184ca
to
e107671
Compare
@KnisterPeter this pull request is now in conflict 😩 |
b082c4f
to
3d40f90
Compare
@KnisterPeter this pull request is now in conflict 😩 |
@KnisterPeter - tested on branch and ready to merge once conflict is fixed |
This commit includes requried changes for running post steps for local and remote actions. This allows general cleanup work to be done after executing an action. Communication is allowed between this steps, by using the action state.
Since composite actions could have multiple pre/post steps inside, we need to run all of them in a single top-level pre/post step. This PR includes a test case for this and the correct order of steps to be executed.
To make sure every post executor/step is executed, it is chained with it's own Finally executor.
Having no step result means we do not run any step (neither pre nor main) and we do not need to run post.
If no pre-if or post-if is given, it should default to 'always()'. This could be set even if there is no pre or post step. In fact this is required for composite actions and included post steps to run.
This PR implements running pre steps for remote actions. This includes remote actions using inside local composite actions.
For post-if conditions the default status check should be always(), while for all other if expression the default status check is success() References: https://docs.github.com/en/actions/learn-github-actions/expressions#status-check-functions https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runspost-if
12bc9a1
to
d243b19
Compare
@KnisterPeter this pull request has failed checks 🛠 |
This is a continuation of #1010
This change implements action post step in combination with the save-state command.
It does support the
post-if
condition.There are a few preparations for action pre steps, but it's not fully implemented in this PR.
Closes #626