From f3571946bde2f4eab31f5dedd5543cd96686d0bd Mon Sep 17 00:00:00 2001 From: coderrob Date: Fri, 14 Feb 2025 01:00:42 -0600 Subject: [PATCH 1/2] chore: ensure a consistent hierarchial naming convention --- .vscode/github-actions.code-snippets | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.vscode/github-actions.code-snippets b/.vscode/github-actions.code-snippets index 64dc8b7..705bc83 100644 --- a/.vscode/github-actions.code-snippets +++ b/.vscode/github-actions.code-snippets @@ -76,7 +76,7 @@ "scope": "yaml" }, "GitHub Actions - Composite Action 'run' Step": { - "prefix": "gha-composite-action-run-step", + "prefix": "gha-composite-action-step-run", "body": [ " - name: ${1:Run Command}", " id: ${2:step_id}", @@ -89,7 +89,7 @@ "scope": "yaml" }, "GitHub Actions - Composite Action 'uses' Step": { - "prefix": "gha-composite-action-uses-step", + "prefix": "gha-composite-action-step-uses", "body": [ " - name: ${1:Use Existing Action}", " id: ${2:step_id}", @@ -200,7 +200,7 @@ "scope": "yaml" }, "GitHub Actions - Workflow Job 'run' Step": { - "prefix": "gha-workflow-job-run-step", + "prefix": "gha-workflow-job-step-run", "body": [ " - name: ${1:Run Command}", " id: ${2:step_id}", @@ -213,7 +213,7 @@ "scope": "yaml" }, "GitHub Actions - Workflow Job 'uses' Step": { - "prefix": "gha-workflow-job-uses-step", + "prefix": "gha-workflow-job-step-uses", "body": [ " - name: ${1:Use Existing Action}", " id: ${2:step_id}", From ce879b1bb16e472ddaf26db6fb2d4e8b5cf128b8 Mon Sep 17 00:00:00 2001 From: coderrob Date: Fri, 14 Feb 2025 01:06:53 -0600 Subject: [PATCH 2/2] chore: update docs with naming updates and two added snippets --- .vscode/github-actions.code-snippets | 2 +- README.md | 27 +++++++++++++++++++++------ 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/.vscode/github-actions.code-snippets b/.vscode/github-actions.code-snippets index 705bc83..30857f8 100644 --- a/.vscode/github-actions.code-snippets +++ b/.vscode/github-actions.code-snippets @@ -127,7 +127,7 @@ "scope": "yaml" }, "GitHub Actions - Node Action": { - "prefix": "gha-node20-action", + "prefix": "gha-node-action", "body": [ "name: ${1:Node.js GitHub Action}", "author: ${2:Your Name}", diff --git a/README.md b/README.md index a9c5271..788586d 100644 --- a/README.md +++ b/README.md @@ -45,12 +45,12 @@ This repository provides a collection of **Visual Studio Code snippets** for **G ### 4️⃣ GitHub Actions - Composite Action 'run' Step -- **Prefix:** `gha-composite-action-run-step` +- **Prefix:** `gha-composite-action-step-run` - **Description:** Inserts a 'run' step for Composite Actions with optional **`if`, `env`, `shell`, and `working-directory`** properties. ### 5️⃣ GitHub Actions - Composite Action 'uses' Step -- **Prefix:** `gha-composite-action-uses-step` +- **Prefix:** `gha-composite-action-step-uses` - **Description:** Inserts a 'uses' step for referencing other actions. ### 6️⃣ GitHub Actions - Docker Action @@ -60,7 +60,7 @@ This repository provides a collection of **Visual Studio Code snippets** for **G ### 7️⃣ GitHub Actions - Node.js Action -- **Prefix:** `gha-node20-action` +- **Prefix:** `gha-node-action` - **Description:** Provides a template for creating a **Node.js 20.x GitHub Action**. ### 8️⃣ GitHub Actions - Workflow Boilerplate @@ -71,9 +71,19 @@ This repository provides a collection of **Visual Studio Code snippets** for **G ### 9️⃣ GitHub Actions - Workflow Job -- **Prefix:** `gha-job` +- **Prefix:** `gha-workflow-job` - **Description:** Inserts a job structure with `runs-on` options and a **job status reference**. +### 4️⃣ GitHub Actions - Workflow Job 'run' Step + +- **Prefix:** `gha-workflow-job-step-run` +- **Description:** Inserts a 'run' step for Composite Actions with optional **`if`, `env`, `shell`, and `working-directory`** properties. + +### 5️⃣ GitHub Actions - Workflow Job 'uses' Step + +- **Prefix:** `gha-workflow-job-step-uses` +- **Description:** Inserts a 'uses' step for referencing other actions. + ## 🛠 How to Use 1. Open a `.yml` file inside the `.github/workflows/` directory. @@ -86,7 +96,7 @@ This repository provides a collection of **Visual Studio Code snippets** for **G **Using the `gha-workflow` snippet:** ```yaml -name: Example Workflow +name: GitHub Workflow on: - push @@ -97,18 +107,23 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Repository + id: checkout-repository uses: actions/checkout@v4 - name: Setup Node.js + id: setup-node uses: actions/setup-node@v4 with: - node-version: "20" + node-version: '20' - name: Install Dependencies + id: install-dependencies run: npm install - name: Run Tests + id: run-tests run: npm test + ``` ## 🔍 Contributing