In a JavaScript action's action.yml, what is the purpose of the 'post:' field under 'runs:'?
Select an answer to reveal the explanation.
Short Explanation and Infographic
The 'post:' script is the action's cleanup crew — it runs at job end regardless of success or failure, perfect for releasing resources.
Full explanation below image
Full Explanation
JavaScript actions can define 'runs.post:' pointing to a script that runs at the end of the job (after all job steps complete). This is useful for cleanup tasks: stopping services started in the 'main:' script, deleting temp files, logging out of systems, posting summary information. The post script runs even if the job failed. Similarly, 'pre:' runs before the main script. 'post-if:' controls when the post step runs (default: always). This pattern is used by actions like actions/cache (post saves the cache) and actions/checkout (post cleans up auth). It has nothing to do with Marketplace publishing or HTTP.