Skip to content

Unexpected behaviour when mixing depends_on and branches #1453

Open
@lazycodeninja

Description

@lazycodeninja

I'm trying to construct a CI/CD pipeline that should build for all Git branches, publish an artifact only for the main branch, and deploy if an artifact was published, e.g.

  - command: ./gradlew build
    key: build

  - command: ./gradlew jib
    key: publish
    branches: "main"

  - command: deploy.sh
    key: deploy
    depends_on: publish

What I've found is that the deploy step executes even though the publish step does not. Worse, if the publish step isn't even defined, the deploy step still runs, e.g.

  - command: ./gradlew build
    key: build

#  - command: ./gradlew jib
#   key: publish
#    branches: "main"

  - command: deploy.sh
    key: deploy
    depends_on: publish

I haven't tried the if property so I don't know if it works the same way as branches, but I wouldn't expect this to be the behaviour for depends_on`. I would expect the step to fail, or at worse, wait indefinitely.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions