-
Notifications
You must be signed in to change notification settings - Fork 7
Debugging GitHub Workflow actions
Helma van der Linden edited this page Sep 10, 2020
·
2 revisions
Recently the publish workflow action failed with an obscure error. Attempts to replicate the exact workflow in a local Ubuntu Vagrant machine failed, probably due to slightly different setups. Replication of the GitHub actions locally is not possible.
That leaves debugging the action as it runs.
Info:
- https://github.community/t/debugging-github-actions-locally-or-ssh-to-workspace/16974
- https://github.com/marketplace/actions/debugging-with-tmate
Preparation:
- add the installation of tmate to the github workflow just before the problematic step
- if necessary change the scheduling frequency to something easier to work with
- commit and push the changes
- commit and push another change in a file not in the .github directory to trigger the new workflow (and activate the new schedule)
Debug:
- wait for the build to run
- open the action and check the steps that are executed
- when tmate executes it will print a command in the console like
ssh <random number>.tmate.io
- copy the command and paste and execute it in a Terminal window
- you are now ssh-ed into the running build and you can debug the problem
Final steps:
- remove the tmate step
- fix the schedule
- commit and push the workflow file
- fix the problem
- commit and push the problem to activate the new version of the workflow (and fix the problem)