Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

GitHub Exam GitHub-Actions Topic 4 Question 15 Discussion

Actual exam question for GitHub's GitHub-Actions exam
Question #: 15
Topic #: 4
[All GitHub-Actions Questions]

As a DevOps engineer, you are developing a container action. You need to execute a cleanup script after completing the main script execution. Which code block should be used to define the cleanup script?

A.

B.

C.

D.

Show Suggested Answer Hide Answer
Suggested Answer: A

The correct syntax for specifying a cleanup script to be run after the main entry point is executed in a Docker-based GitHub Action is to use the post key. This ensures that cleanup.sh runs after the main script (main.sh) has completed.


Contribute your Thoughts:

Robt
21 days ago
Option C has a clear structure for defining the cleanup script after the main script execution.
upvoted 0 times
...
Lindsey
1 months ago
Why do you think Option C is better?
upvoted 0 times
...
Robt
1 months ago
I disagree, I believe Option C is the correct choice for defining the cleanup script.
upvoted 0 times
...
Launa
1 months ago
I'm going with Option C. The `finally` block ensures the cleanup script executes regardless of the main script's outcome.
upvoted 0 times
Shawn
17 days ago
I agree, Option C is the way to go. It guarantees the cleanup script runs no matter what.
upvoted 0 times
...
Gregoria
19 days ago
I think Option C is the best choice. The `finally` block is crucial for cleanup.
upvoted 0 times
...
...
Lindsey
2 months ago
I think the cleanup script should be defined in Option A.
upvoted 0 times
...
Jenise
2 months ago
Option B looks the most straightforward to me. The `on-failure` and `on-success` events make it clear when the cleanup script should run.
upvoted 0 times
Lenora
15 days ago
Yes, Option B with the `on-failure` and `on-success` events provides clear execution conditions for the cleanup script.
upvoted 0 times
...
Xochitl
20 days ago
I agree, Option B seems like the best choice for defining the cleanup script.
upvoted 0 times
...
Aileen
1 months ago
I think Option B is the most efficient way to handle the cleanup script after the main script execution.
upvoted 0 times
...
Lashawnda
1 months ago
The `on-failure` and `on-success` events in Option B provide clear triggers for the cleanup script.
upvoted 0 times
...
Benton
2 months ago
I agree, Option B seems like the best choice for defining the cleanup script.
upvoted 0 times
...
...

Save Cancel