Skip to content

Commit 8ef7755

Browse files
authored
feat: to ease development adding snippets (#1)
1 parent a509791 commit 8ef7755

File tree

2 files changed

+230
-2
lines changed

2 files changed

+230
-2
lines changed

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,5 +101,6 @@ __tests__/runner/*
101101
.idea
102102
*.code-workspace
103103

104-
# VSCode specific files
105-
.vscode/
104+
# VSCode specific files except code-snippets
105+
.vscode/*
106+
!.vscode/*.code-snippets
Lines changed: 227 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,227 @@
1+
/*
2+
*
3+
* Copyright 2025 Robert Lindley
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*
17+
*/
18+
{
19+
"GitHub Actions - Action - Branding": {
20+
"prefix": "gha-action-branding",
21+
"body": [
22+
"branding:",
23+
" color: ${1|blue,green,orange,purple,red,yellow,gray-dark|}",
24+
" icon: ${2|alert,arrow-down-circle,arrow-right-circle,arrow-up-circle,bar-chart,bell,book,bookmark,briefcase,calendar,check-circle,check-square,chevron-down,chevron-left,chevron-right,chevron-up,clock,cloud,code,codesandbox,coffee,columns,command,cpu,credit-card,crosshair,disc,dollar-sign,download,edit,file,file-text,flag,folder,git-branch,git-commit,git-merge,git-pull-request,globe,grid,heart,help-circle,home,image,inbox,info,layout,life-buoy,link,list,lock,mail,map,menu,message-circle,message-square,minus-circle,minus-square,monitor,music,package,paperclip,pen-tool,percent,phone,pie-chart,play,plus-circle,plus-square,pocket,printer,radio,refresh-cloud,repeat,save,search,send,server,settings,shield,shopping-cart,shuffle,sidebar,sliders,smartphone,speaker,star,stop-circle,sun,tag,target,terminal,thumbs-down,thumbs-up,trash,triangle,truck,tv,umbrella,upload,user,users,video,watch,wifi,x-circle,x-square,zoom-in,zoom-out|}"
25+
],
26+
"description": "Insert GitHub Action branding with predefined color and icon options.",
27+
"scope": "yaml"
28+
},
29+
"GitHub Actions - Action - Step Env": {
30+
"prefix": "gha-action-step-env",
31+
"body": [
32+
" env:",
33+
" GITHUB_ACTOR: ${{ github.actor }}",
34+
" GITHUB_REF: ${{ github.ref }}",
35+
" GITHUB_REPOSITORY: ${{ github.repository }}",
36+
" GITHUB_SHA: ${{ github.sha }}",
37+
" GITHUB_WORKSPACE: ${{ github.workspace }}",
38+
" RUNNER_ARCH: ${{ runner.arch }}",
39+
" RUNNER_OS: ${{ runner.os }}"
40+
],
41+
"description": "Insert commonly used GitHub Actions step environment variables.",
42+
"scope": "yaml"
43+
},
44+
"GitHub Actions - Composite Action": {
45+
"prefix": "gha-composite-action",
46+
"body": [
47+
"name: ${1:GitHub Composite Action}",
48+
"author: ${2:Your Name}",
49+
"description: ${3:Describe the composite action}",
50+
"",
51+
"inputs:",
52+
" ${4:input_name}:",
53+
" description: ${5:Input description}",
54+
" required: ${6|true,false|}",
55+
" default: ${7:default_value}",
56+
"",
57+
"outputs:",
58+
" ${8:output_name}:",
59+
" description: ${9:Output description}",
60+
" value: ${{ steps.${10:step_id}.outputs.result }}",
61+
"",
62+
"runs:",
63+
" using: composite",
64+
" steps:",
65+
" - name: Checkout Repository",
66+
" id: checkout-repository",
67+
" uses: actions/checkout@v4",
68+
"",
69+
" - name: ${11:Your Step Name}",
70+
" id: ${12:your-step-id}",
71+
" run: ${13:echo 'Hello World'}",
72+
" shell: ${14|bash,pwsh,sh|}",
73+
""
74+
],
75+
"description": "Boilerplate template for a GitHub Composite Action.",
76+
"scope": "yaml"
77+
},
78+
"GitHub Actions - Composite Action 'run' Step": {
79+
"prefix": "gha-composite-action-step-run",
80+
"body": [
81+
" - name: ${1:Run Command}",
82+
" id: ${2:step_id}",
83+
" if: ${{ ${3:true} }}",
84+
" shell: ${4|bash,pwsh,sh|}",
85+
" run: |",
86+
" ${5:echo 'Hello World'}"
87+
],
88+
"description": "Insert a 'run' step for a GitHub Composite Action.",
89+
"scope": "yaml"
90+
},
91+
"GitHub Actions - Composite Action 'uses' Step": {
92+
"prefix": "gha-composite-action-step-uses",
93+
"body": [
94+
" - name: ${1:Use Existing Action}",
95+
" id: ${2:step_id}",
96+
" uses: ${3:actions/checkout@v4}",
97+
" with:",
98+
" ${4:input_name}: ${5:input_value}"
99+
],
100+
"description": "Insert a 'uses' step for a GitHub Composite Action.",
101+
"scope": "yaml"
102+
},
103+
"GitHub Actions - Docker Action": {
104+
"prefix": "gha-docker-action",
105+
"body": [
106+
"name: ${1:Docker GitHub Action}",
107+
"author: ${2:Your Name}",
108+
"description: ${3:Describe the Docker-based action}",
109+
"",
110+
"inputs:",
111+
" ${4:input_name}:",
112+
" description: ${5:Input description}",
113+
" required: ${6|true,false|}",
114+
" default: ${7:default_value}",
115+
"",
116+
"outputs:",
117+
" ${8:output_name}:",
118+
" description: ${9:Output description}",
119+
"",
120+
"runs:",
121+
" using: docker",
122+
" image: ${10:Dockerfile}",
123+
" args:",
124+
" - ${11:--arg value}"
125+
],
126+
"description": "Insert a template for a Docker-based GitHub Action.",
127+
"scope": "yaml"
128+
},
129+
"GitHub Actions - Node Action": {
130+
"prefix": "gha-node-action",
131+
"body": [
132+
"name: ${1:Node.js GitHub Action}",
133+
"author: ${2:Your Name}",
134+
"description: ${3:Describe the Node.js action}",
135+
"",
136+
"inputs:",
137+
" ${4:input_name}:",
138+
" description: ${5:Input description}",
139+
" required: ${6|true,false|}",
140+
" default: ${7:default_value}",
141+
"",
142+
"outputs:",
143+
" ${8:output_name}:",
144+
" description: ${9:Output description}",
145+
"",
146+
"runs:",
147+
" using: node20",
148+
" main: ${10:./dist/index.js}"
149+
],
150+
"description": "Insert a template for a Node.js 20.x GitHub Action.",
151+
"scope": "yaml"
152+
},
153+
"GitHub Actions - Workflow": {
154+
"prefix": "gha-workflow",
155+
"body": [
156+
"name: ${1:GitHub Workflow}",
157+
"",
158+
"on:",
159+
" - push",
160+
" - pull_request",
161+
"",
162+
"jobs:",
163+
" ${2:build}:",
164+
" runs-on: ${3|ubuntu-latest,windows-latest,macos-latest|}",
165+
" steps:",
166+
" - name: Checkout Repository",
167+
" id: checkout-repository",
168+
" uses: actions/checkout@v4",
169+
"",
170+
" - name: Setup Node.js",
171+
" id: setup-node",
172+
" uses: actions/setup-node@v4",
173+
" with:",
174+
" node-version: '${4|18,20|}'",
175+
"",
176+
" - name: Install Dependencies",
177+
" id: install-dependencies",
178+
" run: npm install",
179+
"",
180+
" - name: Run Tests",
181+
" id: run-tests",
182+
" run: npm test",
183+
""
184+
],
185+
"description": "Boilerplate for a GitHub Actions workflow.",
186+
"scope": "yaml"
187+
},
188+
"GitHub Actions - Workflow Job": {
189+
"prefix": "gha-workflow-job",
190+
"body": [
191+
"jobs:",
192+
" ${1:job_name}:",
193+
" runs-on: ${2|ubuntu-latest,windows-latest,macos-latest|}",
194+
" steps:",
195+
" - name: Print Job Status",
196+
" id: print-job-status",
197+
" run: echo \"Job Status: ${{ job.status }}\""
198+
],
199+
"description": "Insert a GitHub Actions workflow job with status reference.",
200+
"scope": "yaml"
201+
},
202+
"GitHub Actions - Workflow Job 'run' Step": {
203+
"prefix": "gha-workflow-job-step-run",
204+
"body": [
205+
" - name: ${1:Run Command}",
206+
" id: ${2:step_id}",
207+
" if: ${{ ${3:true} }}",
208+
" shell: ${4|bash,pwsh,sh|}",
209+
" run: |",
210+
" ${5:echo 'Hello World'}"
211+
],
212+
"description": "Insert a 'run' step for a GitHub Actions workflow job.",
213+
"scope": "yaml"
214+
},
215+
"GitHub Actions - Workflow Job 'uses' Step": {
216+
"prefix": "gha-workflow-job-step-uses",
217+
"body": [
218+
" - name: ${1:Use Existing Action}",
219+
" id: ${2:step_id}",
220+
" uses: ${3:actions/checkout@v4}",
221+
" with:",
222+
" ${4:input_name}: ${5:input_value}"
223+
],
224+
"description": "Insert a 'uses' step for a GitHub Actions workflow job.",
225+
"scope": "yaml"
226+
}
227+
}

0 commit comments

Comments
 (0)