Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
coverage
.intellij
.eclipse
.vscode
.vscode/*
!.vscode/extensions.json
node_modules
out
yarn-error.log
8 changes: 8 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"github.vscode-pull-request-github",
"sugatoray.vscode-git-extension-pack",
]
}
53 changes: 53 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Contributing guide

## Getting started

The following devfile tasks or npm commands can be used to perform common development tasks for this project.

| **Devfile task** | **Npm command** |
|-------------------------------------------|--------------------------------------------------------------|
| Install dependencies | `npm i` |
| Run linter | `npm run lint` |
| Bundle (generate dist folder) | `npm run bundle` |
| Run tests | `npm run test` |
| Update GitHub action's inputs and outputs | `npx action-io-generator -o src/generated/inputs-outputs.ts` |

## Upating the GitHub action's inputs and outputs
After updating the inputs or outputs in the `try-in-web-ide/action.yml` file, run the `Update GitHub action's inputs and outputs` task to generate the corresponding Typescript definition in `src/generated`.

## Running new changes of the GitHub action within GitHub

To run your new changes to the GitHub action,

1. Run the `Bundle (generate dist folder)` devfile task, or run the `npm run bundle` command in the terminal.
2. Push the resulting `dist` folder to your fork:
```
git push fork your-branch
```
3. Create a private GitHub repository containing a file `.github/workflows/try-in-web-ide.yaml` with the following content:

```
name: try-in-web-ide

on:
pull_request_target:
types: [opened, synchronize]

jobs:
add-link:
runs-on: ubuntu-20.04
steps:
- name: "Checkout source code"
uses: actions/checkout@v3
- name: Eclipse Che Pull Request Link
id: che-pr-check-gh-action
uses: <your-gh-username>/try-in-web-ide@<your-branch>
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
```
Replace `<your-gh-username>` and `<your-branch>` with your username and branch name.

4. Create a PR against your private repository to run the GitHub action.

## Making a PR
Before making a PR, ensure that you have ran the `Run linter`, `Bundle`, and `Run tests` tasks successfully.
40 changes: 40 additions & 0 deletions devfile.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
schemaVersion: 2.2.0
metadata:
name: try-in-web-ide
components:
- name: tools
container:
image: quay.io/devfile/universal-developer-image:ubi8-latest
mountSources: true
memoryLimit: 4Gi
commands:
- id: install-dependencies
exec:
label: "Install dependencies"
component: tools
workingDir: ${PROJECT_SOURCE}
commandLine: "npm i"
- id: run-linter
exec:
label: "Run linter"
component: tools
workingDir: ${PROJECT_SOURCE}
commandLine: "npm run lint"
- id: bundle
exec:
label: "Bundle (generate dist folder)"
component: tools
workingDir: ${PROJECT_SOURCE}
commandLine: "npm run bundle"
- id: run-tests
exec:
label: "Run tests"
component: tools
workingDir: ${PROJECT_SOURCE}
commandLine: "npm run test"
- id: update-action-input-output
exec:
label: "Update GitHub action's inputs and outputs"
component: tools
workingDir: ${PROJECT_SOURCE}
commandLine: "npx action-io-generator -o src/generated/inputs-outputs.ts"