artifacts:when ignored when defined in default section
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Summary
artifacts:when ignored when defined in default: section, according to the doc: https://docs.gitlab.com/ee/ci/yaml/#artifactswhen
Keyword type: Job keyword. You can use it only as part of a job or in the default section.
it should work
Steps to reproduce
default:
image: alpine:latest
artifacts:
when: always
test_fail:
stage: build
artifacts:
paths:
- a.txt
script:
- touch a.txt
- exit 1 # failthe a.txt will not be uploaded
Example Project
both using commit a10c1d34
- code: https://gitlab.com/hanxifu/test-ci/-/blob/a10c1d34448e745130e64b2cf3b16ae73ea3401c/.gitlab-ci.yml
- job: https://gitlab.com/hanxifu/test-ci/-/jobs/6107806234
What is the current bug behavior?
artifact not been uploaded
What is the expected correct behavior?
artifact should be uploaded
Edited by 🤖 GitLab Bot 🤖