当有人取消作业时,如何在 GitHub 操作中挂接并执行清理命令?

How do I hook and execute cleanup commands in a GitHub Action when someone cancels the job?

我正在创建一个动作(使用 actions/javascript-actions)来创建一些东西,然后如果有人中途取消作业则需要清理这些东西。

我找不到如何连接到 pre-exit/cancel 并执行清理操作。这可能吗?有人对实现此目标有任何建议吗?

终于想通了。 actions/checkout is a great example of the post "runs" 实现这个。

runs:
  using: node12
  main: dist/index.js
  post: dist/index.js