Apache Airflow Cancel Workflow Runs 项目教程

Apache Airflow Cancel Workflow Runs 项目教程

airflow-cancel-workflow-runsFork of potiukcancel-workflow-runs action 项目地址:https://gitcode.com/gh_mirrors/ai/airflow-cancel-workflow-runs

1. 项目的目录结构及介绍

airflow-cancel-workflow-runs/
├── .github
│   └── workflows
│       └── cancel-workflow-runs.yml
├── action.yml
├── Dockerfile
├── entrypoint.sh
├── LICENSE
├── README.md
└── src
    └── main.py
  • .github/workflows: 包含GitHub Actions的工作流配置文件。
  • action.yml: 定义GitHub Action的元数据和输入输出参数。
  • Dockerfile: 用于构建Docker镜像的文件。
  • entrypoint.sh: 项目的启动脚本。
  • LICENSE: 项目的许可证文件。
  • README.md: 项目的说明文档。
  • src/main.py: 项目的主要源代码文件。

2. 项目的启动文件介绍

entrypoint.sh

entrypoint.sh 是项目的启动脚本,负责执行主要的逻辑。以下是该文件的基本内容:

#!/bin/sh -l

python /src/main.py

该脚本调用 src/main.py 文件来执行项目的核心功能。

3. 项目的配置文件介绍

action.yml

action.yml 文件定义了GitHub Action的元数据和输入输出参数。以下是该文件的基本内容:

name: 'Cancel Workflow Runs'
description: 'Cancel workflow runs based on specified conditions'
inputs:
  cancelMode:
    description: 'Mode of cancellation'
    required: true
  notifyPRCancel:
    description: 'Notify PR on cancellation'
    required: false
  token:
    description: 'GitHub token'
    required: true
runs:
  using: 'docker'
  image: 'Dockerfile'

该文件定义了Action的名称、描述、输入参数和运行方式。输入参数包括 cancelModenotifyPRCanceltoken,分别用于指定取消模式、是否通知PR以及GitHub token。

.github/workflows/cancel-workflow-runs.yml

.github/workflows/cancel-workflow-runs.yml 文件定义了GitHub Actions的工作流配置。以下是该文件的基本内容:

name: Cancel Workflow Runs
on:
  workflow_run:
    workflows: ['CI']
    types: [requested]
jobs:
  cancel-self-cancelling-run:
    runs-on: ubuntu-latest
    steps:
      - name: Cancel the self Cancelling workflow run
        uses: potiuk/cancel-workflow-runs@master
        with:
          cancelMode: self
          notifyPRCancel: true
          token: ${{ secrets.GITHUB_TOKEN }}

该文件定义了工作流的触发条件和执行步骤。当CI工作流被请求时,执行取消操作。

以上是Apache Airflow Cancel Workflow Runs项目的目录结构、启动文件和配置文件的介绍。希望这些内容能帮助你更好地理解和使用该项目。

airflow-cancel-workflow-runsFork of potiukcancel-workflow-runs action 项目地址:https://gitcode.com/gh_mirrors/ai/airflow-cancel-workflow-runs

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

巫文钧Jill

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值