Closed richm closed 2 years ago
richm closed this 18 minutes ago
May I ask why this pr was closed? Is it accidental?
richm closed this 18 minutes ago
May I ask why this pr was closed? Is it accidental?
It is being replaced by https://github.com/linux-system-roles/firewall/pull/99
The current version doesn't get the branch name in all cases: https://github.com/linux-system-roles/firewall/runs/7530456114?check_suite_focus=true
This is because of the way that the checkout action works. If I use the same method as the checkout action:
so if this fails, try using
git branch --points-at HEAD
- this assumes the code is checked out to the main branch. If you look at the logs from the checkout action of https://github.com/linux-system-roles/firewall/runs/7530456114?check_suite_focus=true and https://github.com/linux-system-roles/metrics/runs/7440737046?check_suite_focus=true you can see that the code somehow has knowledge of the main branch - it knows to use "main" or "master" somehow. So my commit also includes some debugging - maybe we can use$GITHUB_REF
or$GITHUB_REF_NAME
There's also the method that the checkout action uses - https://github.com/actions/checkout/blob/v2.4.2/src/git-command-manager.ts#L201 - where
repositoryUrl
comes from env$GITHUB_SERVER_URL
/$GITHUB_REPOSITORY
see https://docs.github.com/en/actions/learn-github-actions/environment-variables#default-environment-variables for the complete list of env. vars. available to a github action