Skip to content

Fix git archival command failure due to unsafe permissions

Issue/feature addressed

Changes to git means that it refuses to perform the archive operation on directories where the repository directory owner does not match the current user. Due to the way the gitlab-runner manages the cloning of the repository, by bind-mounting it into a container which then runs with a 'nektar' user, this is stopping the job completing.

Proposed solution

Add an exception to the git config in the container to mark the repository directory as safe.

Implementation

Run a git config command prior to the git archival commands.

Tests

Suggested reviewers

@dmoxey , @jhc02

Notes

Job tested on packaging pipeline here: https://gitlab.nektar.info/ccantwel/nektar/-/pipelines/4949

Checklist

  • [ ] Functions and classes, or changes to them, are documented.
  • [ ] User guide/documentation is updated.
  • Changelog is updated.
  • [ ] Suitable tests added for new functionality.
  • [ ] Contributed code is correctly formatted. (See the contributing guidelines).
  • [ ] License added to any new files.
  • No extraneous files have been added (e.g. compiler output or test data files).

Merge request reports