【问题标题】:A workflow is not triggering a second workflow工作流未触发第二个工作流
【发布时间】:2021-01-06 01:01:44
【问题描述】:

当在develop 分支中完成推送时,文件inrisk.packages.ci.yml 中的工作流会生成代码的tagrealise。以下内容按预期工作。

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 DeployCode Int publishes/created tag/realise 之后没有被触发

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

【问题讨论】:

    标签: github github-actions


    【解决方案1】:

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

    我用这个article 来解决这个问题

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-11-02
      • 2020-06-10
      • 2023-01-11
      • 1970-01-01
      • 2021-10-20
      • 2011-03-06
      • 2022-10-17
      • 2021-09-10
      相关资源
      最近更新 更多