Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning: Failed to cancel https://github.com/pingcap/dm/actions/runs/766226952 #103

Closed
lance6716 opened this issue Apr 20, 2021 · 7 comments

Comments

@lance6716
Copy link

lance6716 commented Apr 20, 2021

https://github.com/pingcap/dm/runs/2388157523?check_suite_focus=true

⬆️ This run says it wants to cancel https://github.com/pingcap/dm/actions/runs/766226952 but failed, left a warning. However I see the latter one is stuck in "Queued" status, seems the cancelation somehow taken effects. How could I solve it?

@emabrey
Copy link

emabrey commented Sep 11, 2021

You may have configured your repository settings to make GITHUB_TOKEN restrictive.

Try adding this permission configuration to the build job you use to run this action:

permissions:
  actions: write
  checks: read
  contents: read
  deployments: read
  issues: read
  discussions: read
  packages: read
  pull-requests: read
  repository-projects: read
  security-events: read
  statuses: read

@jneira
Copy link

jneira commented Oct 29, 2021

Hi @emabrey , i am afraid it did not work for me, i've set

permissions:
  actions: write
  pull-requests: write

https://github.com/haskell/haskell-language-server/actions/runs/1398445950/workflow

but the action fails to cancell previous runs:

https://github.com/haskell/haskell-language-server/runs/4045146716?check_suite_focus=true

I suspect it happens if the pr is from a fork (nd most of them are in our case 😟 )

@lance6716
Copy link
Author

Hi @jneira , I found cancel-in-progress and that works. I'm closing this issue now.

https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#example-using-concurrency-to-cancel-any-in-progress-job-or-run

@jneira
Copy link

jneira commented Oct 29, 2021

@lance6716 thanks for the info, i am little bit confused: that option makes the workflow cancel previous builds on its own (having or no the skip-duplicate-actions) or make skip-duplicate-actions cancel attempts works?

@jneira
Copy link

jneira commented Oct 29, 2021

cause if it is the latter, the issue still is reproduced (you are free to close it anyways of course)

jneira added a commit to haskell/haskell-language-server that referenced this issue Oct 29, 2021
Without using skip-duplicate-actions which is failing due to github access permission. 
See fkirc/skip-duplicate-actions#103
@lance6716
Copy link
Author

@lance6716 thanks for the info, i am little bit confused: that option makes the workflow cancel previous builds on its own (having or no the skip-duplicate-actions) or make skip-duplicate-actions cancel attempts works?

skip-duplicate-actions is not needed now :P

@jneira
Copy link

jneira commented Oct 29, 2021

thanks for the clarification, in our case it is giving us other nicities and we want to keep it though so i am opening another issue

mergify bot added a commit to haskell/haskell-language-server that referenced this issue Oct 30, 2021
* Add option to cancel prev runs

Without using skip-duplicate-actions which is failing due to github access permission. 
See fkirc/skip-duplicate-actions#103

* Cancel by branch *and* workflow

Without it will cancel other workflows for the same branch
Credits: 7b371e8b

* Disable cancelling other runs

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
pepeiborra pushed a commit to haskell/haskell-language-server that referenced this issue Nov 2, 2021
* Add option to cancel prev runs

Without using skip-duplicate-actions which is failing due to github access permission. 
See fkirc/skip-duplicate-actions#103

* Cancel by branch *and* workflow

Without it will cancel other workflows for the same branch
Credits: 7b371e8b

* Disable cancelling other runs

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants