GitHub Actions工作流程取消自身的步骤

huangapple go评论64阅读模式
英文:

GitHub Actions workflow cancelling a step on itself

问题

以下是步骤:

- name: run
  if: endsWith(github.ref, '/feature')
  run: |
    echo "installing dependencies"
    pip3 install --upgrade pip
    pip3 install poetry
    cd job-extract/trans/project-v2
    poetry install
    echo "executing dbt"
    make source_dbt
    make run_catalog_server
    make run_scheduled_refresh    

我正在提供 GitHub Actions 工作流程取消步骤的日志, 请告诉我如何解决这个问题。

此外,请告诉我如何使用通知操作来捕获并通知这样的运行?

日志链接:logslink

英文:

Below is the step:

- name: run
  if: endsWith(github.ref, '/feature')
  run: |
    echo "installing dependencies"
    pip3 install --upgrade pip
    pip3 install poetry
    cd job-extract/trans/project-v2
    poetry install
    echo "executing dbt"
    make source_dbt
    make run_catalog_server
    make run_scheduled_refresh    

I am putting the logs which indicate that GitHub Actions workflow is cancelling the step itself. Please let me know how this can be resolved.

Also please let me know how can I use a notify action to catch and notify such runs?

Logs: logslink

答案1

得分: 1

你的工作流程中是否使用了'concurrency'?

我可以使用通知操作来捕获并通知这种运行吗?

是的,你可以尝试类似这样的方式(并将'echo'替换为一些Slack操作):

notification-job:
  needs: build-job
  runs-on: ubuntu-latest
  if: cancelled()
  steps:
    - name: Notification
      run: echo "我被取消了"
英文:

Do you use 'concurrency' in your workflow?

> can i use a notify action to catch and notify such runs?

Yes, you can try something like this (and replace 'echo' with some Slack action):

notification-job:
  needs: build-job
  runs-on: ubuntu-latest
  if: cancelled()
  steps:
    - name: Notification
      run: echo "i was canceled "

huangapple
  • 本文由 发表于 2023年5月29日 19:53:43
  • 转载请务必保留本文链接:https://go.coder-hub.com/76357135.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定