Replace string in file during job not saving to artifacts

Hi!

I have the following in my .gitlab-ci.yml file:

deploy:
    stage: deploy
    script:
    - echo "Fixing package version"
    - sed -i "s/0.0.0+DEV/${CI_COMMIT_TAG}/g" package.json
    only:
    - tags

I would like to replace the 0.0.0+DEV characters with the commit tag name. When the runner runs it does this. However when I download the artifact it still has the 0.0.0+DEV. I’ve probably missed on how to accomplish this. I’m guessing the artifact comes directly from the commit and not what the runner does.

Is there a way to fix this?

Any new update? I’m stuck on this aswell