Skip to content

Let CD extension workflow depend on successful PyPi release #909

Description

@kaklakariada

Checklist

In order to improve the time, how long a bugfix does take, please make sure you address as much as possible of the following checklist.

Summary

Project ansible-collections adds a custom cd-extension.yml workflow for publish to Ansible Galaxy. PTB correctly adds the following in cd.yml:

  cd-extension:
    name: Extension
    uses: ./.github/workflows/cd-extension.yml
    needs:
      - check-release-tag
    secrets:
      ANSIBLE_GALAXY_TOKEN: ${{ secrets.ANSIBLE_GALAXY_TOKEN }}
    permissions:
      contents: write

However the publishing to Ansible Galaxy should only be done when the PyPi release was successful. Without the release on PyPi, the Ansible Collection is not usable.

That's why it would be good if PTB could replace the needs: check-release-tag with needs: build-and-publish. This will ensure that the cd-extension.yml only runs when build-and-publish was successful.

Reproducing the Issue

Reproducibility: always

Steps to reproduce the behavior:

Run

poetry run -- nox -s workflow:generate -- all

Expected Behaviour

Generated job cd-extension uses needs: build-and-publish.

Actual Behaviour

Generated job cd-extension uses needs: check-release-tag.

Additional Context (optional)

Related Issues (optional)

Metadata

Metadata

Assignees

Labels

bugUnwanted / harmful behavior

Type

Fields

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions