octokit / dotnet-sdk

MIT License
54 stars 8 forks source link

[FEAT]: force-cancel #100

Open mikebollandajw opened 1 month ago

mikebollandajw commented 1 month ago

Describe the need

Workflow Cancel is not working from the API despite returning an ACCEPT

Apparently you can force cancel it but we appear to be missing the ability to cancel in the Oktokit library

API Version is: 2022-11-28

https://docs.github.com/rest/actions/workflow-runs#force-cancel-a-workflow-run

  -X POST \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  https://api.github.com/repos/OWNER/REPO/actions/runs/RUN_ID/force-cancel

See:

https://github.com/actions/runner/issues/1846

https://stackoverflow.com/questions/77799456/workflow-stuck-and-not-cancellable

SDK Version

octokit/dotnet-sdk v13.0.1

API Version

2022-11-28

Code of Conduct

github-actions[bot] commented 1 month ago

👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labeled with Status: Up for grabs. You & others like you are the reason all of this works! So thank you & happy coding! 🚀

mikebollandajw commented 1 month ago

Appears to be in this branch: https://github.com/octokit/dotnet-sdk/blob/668e0f0fca8a323a2ad95863c2cdd72dc118442d/src/GitHub/Repos/Item/Item/Actions/Runs/Item/ForceCancel/ForceCancelRequestBuilder.cs#L13

nickfloyd commented 1 month ago

Hey @mikebollandajw Thanks for reaching out.

There might be a little confusion around which SDK you're using that I'd like to clear up. This issue was created in the dotnet-sdk repository which is for our generated SDK - and the branch you reference has been shipped as part of the change sets. The generated SDK dotnet-sdk, is currently in pre-release and is on v.0.0.23

The version number that you are referencing actually belongs to Octokit.net - that is our older, manually written SDK - v13.0.1 being the latest version there.

Please consider using the newer SDK; as you have discovered our generative SDK (dotnet-sdk - available on nuget) is updated with the latest from the GitHub REST API nightly.

Otherwise, we can transfer this issue to the classic Octokit.net repo and label it as "Up for Grabs" so that you or the community can pick it up and add the APIs to the older SDK.