GITHUB-ACTIONS · Question #74
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…
The correct answer is A. runs: using: 'docker' image: 'Dockerfile' entrypoint: 'main.sh' post: 'cleanup.sh'. 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.
Question
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.
Exhibit
Options
- Aruns: using: 'docker' image: 'Dockerfile' entrypoint: 'main.sh' post: 'cleanup.sh'
- Bruns: using: 'docker' image: 'Dockerfile' entrypoint: 'main.sh' post-if: 'cleanup.sh'
- Cruns: using: 'docker' image: 'Dockerfile' entrypoint: 'main.sh' after: 'cleanup.sh'
- Druns: using: 'docker' image: 'Dockerfile' entrypoint: 'main.sh' post-entrypoint: 'cleanup.sh'
How the community answered
(36 responses)- A69% (25)
- B8% (3)
- C17% (6)
- D6% (2)
Explanation
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.
Topics
Community Discussion
No community discussion yet for this question.
