Fix error when committing Github Action Workflow files using Tower on Mac

Web Development

Since the awesome Github Actions were launched I had the issue that I couldn’t commit workflow files to my Github repos using Tower, my favourite Git client.

The error I received was:

[remote rejected] master -> master (refusing to allow an OAuth App to create or update workflow `.github/workflows/cypress-tests.yaml` without `workflow` scope)

So it seemed clear to me what the cause of the problem: Tower didn’t have the workflow permission scope and so the request would be rejected. After talking to Tower support they said that it’s on their todo list but they do not have an ETA for it (for a while now).

As a temporary workaround I used Github Desktop to commit the workflow files. But changing Git clients just for this is a bit annoying.

Using Personal Access Tokens (PAT) to commit Github Action Workflow files today

A friendly Tower support engineer pointed out that to there is a solution for the problem if you use PATs instead of Oauth to connect to Github:

You should be able to work around this by switching your authentication method to Personal Access Token. To do that, simply to go Tower’s Services View (via the cloud icon on the top left, or using the keyboard shortcut Ctrl+Cmd+S). Right-click on your GitHub service account in the left sidebar, and select Edit. Then, select Personal Access Token as your authentication method and enter your PAT.

…and it works perfectly 🎉

How to change your authentication method to PAT

Edit your Github account settings within Tower and change “Authentication” to “Personal Access Token”:

In your Github Developer Settings create a new Personal Access Token that that contains the original scopes which Tower needs. Then make sure to also include the “workflow” scope of course:

Use the displayed Access Token within Tower and everything should work out of the box.

Dein Kommentar

Hinweis: Deine E-Mailadresse wird nicht veröffentlicht.

This site uses Akismet to reduce spam. Learn how your comment data is processed.