microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.95k stars 29.53k forks source link

Can't push changes to Github workflows if VS Code authenticated as OAuth Github app #97396

Closed tysonite closed 4 years ago

tysonite commented 4 years ago

Issue Type: Bug

Error will appear:

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

VS Code version: Code 1.45.0 (d69a79b73808559a91206d73d7717ff5f798f23c, 2020-05-07T16:18:48.860Z) OS version: Windows_NT x64 10.0.18363 Remote OS version: Linux x64 4.4.0-18362-Microsoft

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i5-9300H CPU @ 2.40GHz (8 x 2400)| |GPU Status|2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
protected_video_decode: enabled
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
viz_display_compositor: enabled_on
viz_hit_test_surface_layer: disabled_off_ok
webgl: enabled
webgl2: enabled| |Load (avg)|undefined| |Memory (System)|7.82GB (2.97GB free)| |Process Argv|| |Screen Reader|no| |VM|0%| |Item|Value| |---|---| |Remote|WSL: Ubuntu-18.04| |OS|Linux x64 4.4.0-18362-Microsoft| |CPUs|Intel(R) Core(TM) i5-9300H CPU @ 2.40GHz (8 x 2400)| |Memory (System)|7.82GB (2.97GB free)| |VM|0%|
Extensions (4) Extension|Author (truncated)|Version ---|---|--- python|ms-|2020.4.76186 remote-ssh|ms-|0.51.0 remote-ssh-edit|ms-|0.51.0 remote-wsl|ms-|0.44.2
joaomoreno commented 4 years ago

Oh that's pretty rough. Maybe let's add a workflow scope to it.

@RMacfarlane How easy is it to redefine the scopes for an existing credential, which users might already have cached?

RMacfarlane commented 4 years ago

Unfortunately it's not possible to modify an existing token to add scopes, a new one has to be requested with the additional scopes

joaomoreno commented 4 years ago

@RMacfarlane What I meant to ask was: users will simply get asked to go through the flow once again if I change the scopes here, right? https://github.com/microsoft/vscode/blob/master/extensions/git/src/github.ts#L23-L23

RMacfarlane commented 4 years ago

Yep, that's correct!

JacksonKearl commented 4 years ago

Whats the process for registering VSCode as an OAuth app?

joaomoreno commented 4 years ago

@JacksonKearl This is the automatic git auth in VS Code: if you try to pull/push from a git repo using HTTPS, authentication will happen automatically with the GH auth provider.

Steps:

  1. Clone a repo from GitHub
  2. Make a change to a workflow file
  3. Push
JacksonKearl commented 4 years ago

Havent been able to repro the initial error in Stable. Steps:

In a VM without my git auth already registered:

This is on Windows 10

joaomoreno commented 4 years ago

Maybe it's specific to the workflow or to our auth. I also didn't repro before the change.

Marking as verified.

WouterDeKort commented 4 years ago

I have the same issue when using Visual Studio CodeSpaces. I've cloned a repo with a workflow file, made a change to the workflow file and now get the error on push that my OAuth App doesn't have the workflow scope.