Skip to content

Inconsistent path resolution when using different includes syntax #2620

@leganck

Description

@leganck

Description

In the directory C:\Users\xxx\Desktop\teskfile-err, running task web:portal returns the path C:\Users\xxx\Desktop\teskfile-err\.But if I modify the includes block in web/main.yml to specify the taskfile key explicitly like this:

yaml
includes:
  portal:
    taskfile: portal.yml

The output path will change to C:\Users\xxx\Desktop\teskfile-err\web.

Version

3.46.4

Operating system

win11

Experiments Enabled

No response

Example Taskfile

YAML
taskfile.yml


includes:
  web: web/main.yml
vars:
  GREETING: Hello, world!

tasks:
  default:
    desc: Print a greeting message
    cmds:
      - echo "{{.GREETING}}"
    silent: true

web/main.yml

includes:
  portal: portal.yml

tasks:
  web:
    desc: Run web-related tasks
    cmds:
      - pwd
      - echo "Running web tasks..."

web/portal.yml


tasks:
  portal:
    desc: Run portal-related tasks
    cmds:
      - pwd
      - echo "Running portal tasks..."

Metadata

Metadata

Assignees

No one assigned

    Labels

    state: needs triageWaiting to be triaged by a maintainer.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions