工作流程未触发第二个工作流程

时间:2020-09-19 08:25:34

标签: github github-actions

inrisk.packages.ci.yml分支中进行推送时,文件tag中的工作流程会生成realisedevelop的代码。以下按预期工作。

name: Code Int

on:
  push:
    paths:
      - 'infra/**'

jobs:
  ci:
    runs-on: ubuntu-latest
    steps:
      # Checks-out to $GITHUB_WORKSPACE
      - uses: actions/checkout@v2
      - name: Basic Checks
        run: |
          whoami
          ls -lah
          pwd
      - uses: actions/setup-node@v1
      # Create a new release when on develop which triggers the deployment
      - name: Bump version and push tag
        if: github.ref == 'refs/heads/develop'
        uses: mathieudutour/github-tag-action@v4.5
        id: tag_version
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      - name: Create Release
        if: github.ref == 'refs/heads/develop'
        id: create_release
        uses: actions/create-release@v1
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          tag_name: ${{ steps.tag_version.outputs.new_tag }}
          release_name: Release ${{ steps.tag_version.outputs.new_tag }}
          draft: false
          prerelease: false

文件inrisk.packages.cd.yml中的以下工作流程,假设在tag / realisecreated / published时被触发。

name: Code Deploy

on:
  push:
    tags:
      - 'v*'
  release:
    types:
      - published
      - created
      - released

jobs:
  build-and-deploy:
    runs-on: ubuntu-latest
    steps:
      # Checks-out to $GITHUB_WORKSPACE
      - uses: actions/checkout@v2
      - uses: actions/setup-node@v1
      - name: Install Yarn
        run: npm install -g yarn
      - uses: chrislennon/action-aws-cli@v1.1
      - name: Install, Build and Deploy
        run: |
          whoami
          ls -lah
          pwd

Code Deploy Code Int / publishescreated / tag

之后,第二个工作流程realise没有触发

但是,当我手动创建realise / tag时,第二个工作流程Code Deploy被触发

1 个答案:

答案 0 :(得分:0)

这似乎是here所述的设计,这是为了停止递归工作流运行。

我用这个article来解决问题