Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
143 views
in Technique[技术] by (71.8m points)

How do I re-run Github Actions?

I see this on the Github web UI:

screenshot

but it's not clear to me whether the disabled re-runs are a result of my .github/main.workflow configuration, or inherited from the Github Actions service.

Sample workflow below - I don't see anything obvious there that would disable re-runs.

workflow "Test, Lint" {
  on = "push"
  resolves = [
    "Test",
    "Lint",
    "Lint Format"
  ]
}

action "Install" {
  uses = "actions/npm@master"
  args = "install"
  secrets = ["SECRET_TOKEN"]
}

action "Test" {
  needs = "Install"
  uses = "actions/npm@master"
  args = "test"
  secrets = ["SECRET_TOKEN"]
}

action "Lint" {
  needs = "Install"
  uses = "actions/npm@master"
  args = "run lint"
  secrets = ["SECRET_TOKEN"]
}

action "Lint Format" {
  needs = "Install"
  uses = "actions/npm@master"
  args = "run lint:format"
  secrets = ["SECRET_TOKEN"]
}
question from:https://stackoverflow.com/questions/56435547/how-do-i-re-run-github-actions

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

There are two situations:

1) On a failed build, from the docs

Optionally, if the run failed, to re-run the workflow, in the upper-right corner of the workflow, use the Re-run checks drop-down menu, and select Re-run all checks. rerun

2) If your run did not fail, you have to trigger the event which your workflow runs on:.

In the most usual case of on: push, you can add an empty commit to poke GitHub actions:

git commit --allow-empty -m "trigger GitHub actions"
git push

This will add an empty commit (no files changed), and will trigger another push event on GitHub, and therefore trigger another workflow run.

This does, however, muck up the commit history. You can later squash/remove these if you like, but it's perhaps not ideal.


This is an update to my original answer, which referred to GitHub Actions HCL-based v1, prior to the August 2019 YAML-based re-release. @tuff got this right first, with @instantepiphany‘s caveat.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...