]> git.ipfire.org Git - thirdparty/kmod.git/commit
ci: Improve double checkout where needed
authorLucas De Marchi <lucas.de.marchi@gmail.com>
Wed, 12 Mar 2025 16:20:32 +0000 (11:20 -0500)
committerLucas De Marchi <lucas.de.marchi@gmail.com>
Tue, 25 Mar 2025 19:04:46 +0000 (14:04 -0500)
commit1f1501785eb28557ae47b686ccee2b793ecd6eb8
treebd013c2d711c74bf32eeaf7e05869b5245d347bd
parent19219f32513f3c16adbc46940de575e6d50d7e55
ci: Improve double checkout where needed

In the main workflow the problem needing a double checkout is that
git may not be available in the containers we are using which causes the
action/checkout to use a tarball. However some of the steps (e.g. meson
dist) need the checkout to be a real git checkout.

Improve the double checkout by doing the first checkout to a local-actions
directory that can be removed after the setup is done. Even if doing it
in a separate dir, the CWD still belongs to a different user as
additional debugs show before removing that directory:

ls -la .
total 12
drwxr-xr-x  3 1001  118 4096 Mar 12 18:35 .
drwxr-xr-x  3 1001  118 4096 Mar 12 18:35 ..
drwxr-xr-x 10 root root 4096 Mar 12 18:35 local-actions

ls -la ..
total 12
drwxr-xr-x 3 1001  118 4096 Mar 12 18:35 .
drwxr-xr-x 6 1001 root 4096 Mar 12 18:35 ..
drwxr-xr-x 3 1001  118 4096 Mar 12 18:35 kmod

Move the safe directory setting to the cleanup step.

Another alternative would be to use the setup-os action from a "remote"
repository, i.e. kmod-project/kmod/.github/actions/setup-os. However it
would make harder to update it in PRs since it would fetch the action
from a different branch.

Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/321
.github/workflows/main.yml