Extract script outside of action.yml + remove unused code + add test that does not rely on a remote wireguard server #8
Conversation
|
Crazy, again this error ! |
|
Force pushing does not re-run the workflow.. Too bad :p |
|
I don't get it, it is running without issue on my GHA "runs-on: ubuntu-latest".. |
|
So issue is most likely at line 72 https://github.com/egor-tensin/setup-wireguard/pull/8/files#diff-c992f6abfc7ff51f20d8266ec1acff44ac43ff1e87bcc75968bc2b9f0b72da23R72 As this is the only change I made in this file (with the management of the variables). But I really don't understand why. Crazy bash array expansion. |
Please see a page on my website about bash: https://egort.name/blog/notes/bash.html. Especially under "Arrays" -> "Expansion". Basically, the rule is: always expand arrays using |
|
I was not previously aware of the |
|
I think the error is triggered by the fact that the vars are missing ! And the bash error: It is coming from the line 51 : https://github.com/egor-tensin/setup-wireguard/pull/8/files#diff-c992f6abfc7ff51f20d8266ec1acff44ac43ff1e87bcc75968bc2b9f0b72da23R51 With ifname defined but not ip: |
|
Can you try to run the workflow manually from your side ? Does Github keeps the secrets empty when it's executed by a pull request ? The only var going through is the keepalive with the value 25.. |
2031118 to
7a281cf
Compare
Extracting the code from the yaml file allows for easier editing and use of linter tools. Additionally, unused code has been removed. Signed-off-by: Thibault Gérondal <thibault.gerondal@sortlist.com>
This commit enables testing of the code against a Wireguard server in a netns. This avoids any connection to the outside (no more security issues) and makes the test robust and reproducible for anyone who wants to do so. Signed-off-by: Thibault Gérondal github@tycale.be>
The previous array expansion is useful only if the bash array is not defined. As the array is defined before, this can be simplified. Signed-off-by: Thibault Gérondal <github@tycale.be>
|
@egor-tensin What do you think about this change ? This makes the test self-contained thanks to network namespaces. |
Signed-off-by: Thibault Gérondal <contact@tycale.be>
Signed-off-by: Thibault Gérondal <thibault@initia.cloud>

Extracting the bash script outside of the yaml file helps in order to apply Shellcheck and other linters. It showed no errors, so that's great ! I removed the unused code (about systemD) as I think it's a bit confusing. I changed the array call for the additional arguments. I pushed everything in a single commit, sorry for that.
Thanks for this helpful Github action.