nektos / act

Run your GitHub Actions locally 🚀
https://nektosact.com
MIT License
51.87k stars 1.3k forks source link

Fix #2363. Add /pre- and /post-entrypoint handling #2377

Open AndriiChyrva opened 5 days ago

AndriiChyrva commented 5 days ago

Fix #2363. Add /pre- and /post-entrypoint handling

ChristopherHX commented 4 days ago

Thank you for wanting to implement this, I think that I should provide you some pointer where these pre/post steps should be run to not cause some unexpected execution orders

Those pre/pre steps are managed by the following: https://github.com/nektos/act/blob/935e4c37aed0af647cd8ed99713901edf3018b79/pkg/runner/action.go#L488-L651

hasPreStep should return true if your preentrypoint field is non empty and the type is docker action, similar to post in the later methods.

You could pass the entrypoint to the execasdocker and call it also for pre/post sections of the referenced code

What you have done so far reads like you do

If you have more than a single step it could look like

I would expect, that is enshured by the advanced pre post logic written by former maintainers

codecov[bot] commented 4 days ago

Codecov Report

Attention: Patch coverage is 81.39535% with 8 lines in your changes missing coverage. Please review.

Project coverage is 76.37%. Comparing base (5a80a04) to head (4204ed8). Report is 85 commits behind head on master.

Files Patch % Lines
pkg/runner/action.go 81.39% 6 Missing and 2 partials :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #2377 +/- ## =========================================== + Coverage 61.56% 76.37% +14.81% =========================================== Files 53 61 +8 Lines 9002 7856 -1146 =========================================== + Hits 5542 6000 +458 + Misses 3020 1300 -1720 - Partials 440 556 +116 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.