Skip to content

Commit c480426

Browse files
authored
back to git bash
1 parent 27579f2 commit c480426

2 files changed

Lines changed: 15 additions & 47 deletions

File tree

README.md

Lines changed: 14 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,26 @@
1-
# VS Code Server Action
2-
3-
> A GitHub Action that allows to debug GitHub workflows using VS Code.
4-
5-
Failing CI builds can be annoying especially since we don't have access to the machines that run them. While tests might pass locally for you, they still can fail in the CI environment.
6-
7-
This GitHub Action helps to debug these problems by registering a VS Code Server instance on the CI machine that allows you to connect with the machine in case the build fails.
8-
9-
![Connect VS Code to GitHub workflows](./.github/assets/demo.gif "Connect VS Code to GitHub workflows")
1+
# Setup code-server
102

113
## Usage
124

13-
In your GitHub workflow add the following step at the end of all steps:
5+
👇 This demo workflow will install code-server and then start a new VS Code web
6+
IDE instance that you can view using something like [ngrok] or [cloudflared].
7+
Check out the [other @cidebug actions] like [setup-ngrok] or [setup-cloudflared]
148

15-
```yaml
9+
```yml
10+
on: push
1611
jobs:
17-
test:
18-
name: Test
12+
code-server:
1913
runs-on: ubuntu-latest
20-
# make sure these permissions are set so that
21-
# VS Code can connect to the machine
22-
permissions:
23-
actions: read
24-
contents: read
2514
steps:
26-
# ...
27-
- name: 🐛 Debug Build
28-
uses: stateful/vscode-server-action@v1
29-
if: failure()
30-
with:
31-
machineName: myMachine # optional, default: GitHub workflow run ID
32-
timeout: '30000' # optional, default: 30000
33-
```
34-
35-
In case your build fails the action attempts to start a VS Code Server on the build machine and requests you to authorize it:
36-
37-
```
38-
To grant access to the server, please log into https://github.com/login/device and use code 0328-F81A
15+
- uses: cidebug/setup-code-server@v1
16+
- run: code-server
3917
```
4018
41-
If you don't authorize the machine until the `timeout` was hit the build just continues. Once authorized through a VS Code Server is started and it prints an URL to connect to, e.g.:
19+
After code-server has been setup, you can run it like this:
4220
21+
```sh
22+
code-server
4323
```
44-
Open this link in your browser https://vscode.dev/tunnel/myMachine/github/workspace
45-
```
46-
47-
You can also connect to it through your local VS Code application. Just open the URL, open the command palette and enter `Open in VS Code`.
48-
49-
## Inputs
50-
51-
- `machineName` (optional): name of the machine to access (default: GitHub Action run id)
52-
- `timeout` (optional): the time until the action continues the build if the machine does not get authorized (default: 30s)
53-
54-
## Contribute
55-
56-
Simply raise a pull request 🙂 Make sure CI passes and then you should be good to go.
5724

25+
📚 Make sure you check out the code-server documentation for a full account of
26+
all the options that you can play around with!

main.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ set -ex
44
if [[ $RUNNER_OS == Windows ]]; then
55
export FORCE_NODE_VERSION=1
66
old_script_shell=$(npm config get script-shell)
7-
# https://github.com/actions/runner-images/blob/main/images/win/Windows2022-Readme.md#shells
8-
npm config set script-shell 'C:\Windows\System32\bash.exe'
7+
npm config set script-shell 'C:\Program Files\Git\bin\bash.exe'
98
npm install --global "code-server@$INPUT_CODE_SERVER_VERSION" --unsafe-perm
109
npm config set script-shell "$old_script_shell"
1110
else

0 commit comments

Comments
 (0)