Skip to content

docker: nx release doesn't replace {version} in git tag if project doesn't contain docker file #34382

@thdk

Description

@thdk

Current Behavior

I understand this is a configuration issue on my side but the error I receive is:


 NX   Unexpected error when creating tag app-3@{version}:


fatal: 'app-3@{version}' is not a valid tag name.

Error: Unexpected error when creating tag app-3@{version}:

fatal: 'app-3@{version}' is not a valid tag name.

    at gitTag (/Users/thdk/repos/thdk/nx-monorepo-demo/node_modules/nx/src/command-line/release/utils/git.js:436:15)
    at processTicksAndRejections (node:internal/process/task_queues:105:5)
    at release (/Users/thdk/repos/thdk/nx-monorepo-demo/node_modules/nx/src/command-line/release/release.js:170:17)
    at handleErrors (/Users/thdk/repos/thdk/nx-monorepo-demo/node_modules/nx/src/utils/handle-errors.js:8:24)
    at Object.handler (/Users/thdk/repos/thdk/nx-monorepo-demo/node_modules/nx/src/command-line/release/command-object.js:101:24)

(Pipeline: https://github.com/thdk/nx-monorepo-demo/actions/runs/21835948797/job/63006917521?pr=23)

Eventually I noticed that I hadn't added a Dockerfile for this project yet. After adding one the version was correctly replaced.

Expected Behavior

I expected an error message saying that the project can't be versioned without a dockerfile.

GitHub Repo

https://github.com/thdk/nx-monorepo-demo/tree/b33e9c63bcb52888e06254cea95798de9e092415

Steps to Reproduce

Checkout the github repo at exact commit from the link.

npx nx release --group apps --dockerVersionScheme semver --skip-publish

Nx Report

Node           : 24.11.0
OS             : darwin-arm64
Native Target  : aarch64-macos
npm            : 11.6.1

nx                     : 22.3.3
@nx/js                 : 22.3.3
@nx/eslint             : 22.3.3
@nx/workspace          : 22.3.3
@nx/jest               : 22.3.3
@nx/devkit             : 22.3.3
@nx/esbuild            : 22.3.3
@nx/eslint-plugin      : 22.3.3
@nx/module-federation  : 22.3.3
@nx/nest               : 22.3.3
@nx/node               : 22.3.3
@nx/playwright         : 22.3.3
@nx/plugin             : 22.3.3
@nx/react              : 22.3.3
@nx/rollup             : 22.3.3
@nx/vite               : 22.3.3
@nx/vitest             : 22.3.3
@nx/web                : 22.3.3
@nx/webpack            : 22.3.3
@nx/docker             : 22.3.3
typescript             : 5.9.3
---------------------------------------
Registered Plugins:
@nx/js/typescript
@nx/eslint/plugin
@nx/jest/plugin
@nx/react/router-plugin
@nx/vite/plugin
@nx/playwright/plugin
@thdk/nx-terraform/plugin
@nx/docker
@nx/vitest
@nx/webpack/plugin
---------------------------------------
Local workspace plugins:
@thdk/nx-terraform
---------------------------------------
Cache Usage: 16.39 MB / 46.04 GB

Failure Logs

Package Manager Version

No response

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

No response

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions