I have two workflows: CI (running automated tests and lint) and CD (building docker images based on new tags added to the repo).
name: CI on: push: tags: v[1-9]+.[0-9]+.[0-9]+ pull_request: branches: [develop, hotfix*]
name: CD on: workflow_run: workflows: ['CI'] push: tags: v[1-9]+.[0-9]+.[0-9]+ types: - completed
As you can see, the CD workflow is triggered via
workflow_run. My current goal is to read the tag name in the CD workflow to tag docker images but seems that is not possible to do it when the workflow is triggered via
workflow_run.I have tried using some actions like action-get-tag.
So, my question is: how can I read the tag name in the first workflow (CI) and pass it to the second workflow (CD)?
I know that I can pass data between jobs and steps, but don’t know how to do it between workflows. Thanks!