Skip to content

Included Taskfile watch: true not working #1763

Closed

Description

@Firesphere

I have a root Taskfile, that includes a Taskfile from a folder named watch
For simplicity, my tasks:

Taskfile.yml

version: "3"
interval: 500ms
dotenv: ['.env.local', '.env.dev']
includes:
  watch:
    taskfile: ./watch
    aliases: [w]

watch/Taskfile.yml

version: "3"

tasks:
  build:*:
    watch: true
    sources:
      - '${PROJECTS}/*-bin/*.go'
    cmds:
      - echo "hello world"

This watcher works if I put it in the root of my Taskfile set. But the subfolder task does not watch, for reasons unclear to me, I couldn't find any documentation about it, and I would expect that the $(PROJECTS), which is a full absolute path in .env.local, should/would "just work" ™️?

  • Task version: 3.38.0
  • Operating system: MacOS Sonoma 14.6.1
  • Experiments enabled: No

Activity

  1. added
    area: watcherChanges related to the Taskfile watcher.
    and removed
    state: needs triageWaiting to be triaged by a maintainer.
    on May 26, 2025
  2. added theissue type on May 26, 2025
  3. safigo commented on Oct 28, 2025

    @safigo

    I'm experiencing the same issue.

    There are two files: Taskfile.yaml and watch/Taskfile.yaml.
    Including with this declaration:

    includes:
      watch:
        dir: ./watch
        taskfile: ./watch/Taskfile.yaml
    

    When I run task from watch/Taskfile.yaml directly watch is starting:

    ❯ task -t watch/Taskfile.yaml build
    task: Started watching for tasks: build
    task: [build] go build main.go
    ...
    

    But when I run from the main Taskfile.yaml the watch step is skipped:

    ❯ task watch:build
    task: [watch:build] go build main.go
    ...
    

    However, I can force it with task -w watch:build that makes it to work well:

    ❯ task watch:build -w
    task: Started watching for tasks: watch:build
    task: [watch:build] go build main.go
    ...
    
  4. trulede commented on Feb 9, 2026

    @trulede
    Contributor

    @safigo @Firesphere I've opened a PR with a fix for this issue. You might like to test it and see if it really does fix your issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: watcherChanges related to the Taskfile watcher.

    Type

    Fields

    No fields configured for bug.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      ⌂ 换网址