Regression 18.1: Stop following symlinks when archiving documents

!5543 (comment 2754258256) created a regression since GitLab runner %18.1 as artifacts behind a symbolic link are no longer archived:

test:
  variables:
    GIT_STRATEGY: none
  script:
    - mkdir sub
    - mkdir sub/dir
    - touch sub/dir/file
    - ln -s dir sub/link
    - tree || ls -gGhR
  artifacts:
    paths:
      # - sub/dir/file  # OK
      # - sub/link/file  # OK
      - sub/l*/file  # FAIL
$ tree sub
sub
├── dir
│   └── file
└── link -> dir
  • Before GitLab runner %18.1 l* was resolved to link and the link was followed, leading to sub/link/file being archived.
  • Since 18.1 this no longer works no no artifacts are found:

    WARNING: sub/l*/file: no matching files. Ensure that the artifact path is relative to the working directory (/builds/PHahn/ci-playground)
    ERROR: No files to upload

Full example is here: https://gitlab.com/pmhahn/ci-playground/-/blob/artifact-symlink/.gitlab-ci.yml?ref_type=heads

!5543 (merged) switched to doublestar.WithNoFollow() to prevent a denial-of-service attack as the previous implementation followed symbolic links to parent directories.