{"id":25543439,"url":"https://github.com/coderrob/github-actions-snippets","last_synced_at":"2025-06-13T02:05:02.093Z","repository":{"id":277485751,"uuid":"932563276","full_name":"Coderrob/github-actions-snippets","owner":"Coderrob","description":"Visual Studio Code GitHub Actions and Workflows Code Snippets","archived":false,"fork":false,"pushed_at":"2025-02-14T14:58:02.000Z","size":21,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-30T05:48:08.563Z","etag":null,"topics":["code-snippets","github-actions","github-workflows"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Coderrob.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["coderrob"],"buy_me_a_coffee":"coderrob"}},"created_at":"2025-02-14T05:41:49.000Z","updated_at":"2025-02-14T14:58:04.000Z","dependencies_parsed_at":"2025-02-14T07:22:09.432Z","dependency_job_id":"c506a8ce-ed2f-4504-9808-05a5d2933b0a","html_url":"https://github.com/Coderrob/github-actions-snippets","commit_stats":null,"previous_names":["coderrob/github-action-snippets"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Coderrob/github-actions-snippets","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Coderrob%2Fgithub-actions-snippets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Coderrob%2Fgithub-actions-snippets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Coderrob%2Fgithub-actions-snippets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Coderrob%2Fgithub-actions-snippets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Coderrob","download_url":"https://codeload.github.com/Coderrob/github-actions-snippets/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Coderrob%2Fgithub-actions-snippets/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259565565,"owners_count":22877347,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["code-snippets","github-actions","github-workflows"],"created_at":"2025-02-20T07:19:19.426Z","updated_at":"2025-06-13T02:05:02.069Z","avatar_url":"https://github.com/Coderrob.png","language":null,"funding_links":["https://github.com/sponsors/coderrob","https://buymeacoffee.com/coderrob"],"categories":[],"sub_categories":[],"readme":"# GitHub Actions VS Code Snippets\n\nThis repository provides a collection of **Visual Studio Code snippets** for **GitHub Actions** and **GitHub Actions Workflows**. These snippets simplify the process of writing, editing, and managing **GitHub Actions YAML files**, ensuring correctness and completeness with predefined property selections.\n\n## 🚀 Features\n\n- **Predefined GitHub Action Templates** for Composite, Docker, and Node.js Actions.\n- **Workflow Boilerplate** to quickly set up CI/CD pipelines.\n- **Environment Variables** to insert commonly used GitHub Actions context values.\n- **Comprehensive Properties** for branding, inputs, outputs, and steps.\n- **Auto-completion and Selection Options** for colors, icons, and OS environments.\n- **Error-Free YAML Formatting** for valid and structured configurations.\n\n## 📌 Installation\n\n1. Create a .vscode folder in your project root (if it doesn’t exist).\n1. Inside .vscode, create or move your github-actions.code-snippets file.\n1. Restart VS Code (Ctrl + Shift + P → Reload Window).\n1. Open a .yml or .yaml file and type the snippet prefix (e.g., gha-workflow).\n1. Manually invoke the snippet picker using:\n\n   Windows/Linux: `Ctrl + Space`  \n   Mac: `Cmd + Space`\n\n   The snippets should now appear! 🎉\n\n## 🔥 Available Snippets\n\n### 1️. GitHub Actions - Branding\n\n- **Prefix:** `gha-action-branding`\n- **Description:** Inserts branding details for a custom GitHub Action.\n- **Properties:** `color`, `icon` (predefined values for easy selection).\n\n### 2️. GitHub Actions - Common Environment Variables\n\n- **Prefix:** `gha-action-step-env`\n- **Description:** Inserts commonly used GitHub Actions step environment variables.\n- **Includes:** `GITHUB_ACTOR`, `GITHUB_REPOSITORY`, `GITHUB_REF`, `GITHUB_SHA`, `GITHUB_WORKSPACE`, `RUNNER_OS`, `RUNNER_ARCH`.\n\n### 3️. GitHub Actions - Composite Action\n\n- **Prefix:** `gha-composite-action`\n- **Description:** Creates a Composite GitHub Action with configurable inputs, outputs, and steps.\n\n### 4️. GitHub Actions - Composite Action 'run' Step\n\n- **Prefix:** `gha-composite-action-step-run`\n- **Description:** Inserts a 'run' step for Composite Actions with optional **`if`, `env`, `shell`, and `working-directory`** properties.\n\n### 5️. GitHub Actions - Composite Action 'uses' Step\n\n- **Prefix:** `gha-composite-action-step-uses`\n- **Description:** Inserts a 'uses' step for referencing other actions.\n\n### 6️. GitHub Actions - Docker Action\n\n- **Prefix:** `gha-docker-action`\n- **Description:** Provides a template for creating a **Docker-based GitHub Action**.\n\n### 7️. GitHub Actions - Node.js Action\n\n- **Prefix:** `gha-node-action`\n- **Description:** Provides a template for creating a **Node.js 20.x GitHub Action**.\n\n### 8️. GitHub Actions - Workflow Boilerplate\n\n- **Prefix:** `gha-workflow`\n- **Description:** Inserts a **GitHub Actions Workflow** template with `push` and `pull_request` triggers.\n- **Includes:** `checkout`, `setup-node`, `install dependencies`, and `run tests` steps.\n\n### 9️. GitHub Actions - Workflow Job\n\n- **Prefix:** `gha-workflow-job`\n- **Description:** Inserts a job structure with `runs-on` options and a **job status reference**.\n\n### 10. GitHub Actions - Workflow Job 'run' Step\n\n- **Prefix:** `gha-workflow-job-step-run`\n- **Description:** Inserts a 'run' step for Composite Actions with optional **`if`, `env`, `shell`, and `working-directory`** properties.\n\n### 11. GitHub Actions - Workflow Job 'uses' Step\n\n- **Prefix:** `gha-workflow-job-step-uses`\n- **Description:** Inserts a 'uses' step for referencing other actions.\n\n## 🛠 How to Use\n\n1. Open a `.yml` file inside the `.github/workflows/` directory.\n2. Type the **prefix** (e.g., `gha-`) and select the snippet from the suggestions.\n3. Use the placeholders and tab through the fields to customize.\n4. Save the file and push it to GitHub to trigger the workflow.\n\n## 📖 Example Usage\n\n**Using the `gha-workflow` snippet:**\n\n```yaml\nname: GitHub Workflow\n\non:\n  - push\n  - pull_request\n\njobs:\n  build:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Checkout Repository\n        id: checkout-repository\n        uses: actions/checkout@v4\n\n      - name: Setup Node.js\n        id: setup-node\n        uses: actions/setup-node@v4\n        with:\n          node-version: '20'\n\n      - name: Install Dependencies\n        id: install-dependencies\n        run: npm install\n\n      - name: Run Tests\n        id: run-tests\n        run: npm test\n\n```\n\n## 🔍 Contributing\n\nFeel free to contribute by submitting a **Pull Request (PR)** or opening an **Issue** to suggest improvements or report any bugs.\n\n## 🎯 License\n\nThis project is licensed under the **Apache License V2.0 License**.\n\n---\n\n📢 **Follow GitHub Actions best practices to ensure optimal CI/CD performance!** 🚀\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoderrob%2Fgithub-actions-snippets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoderrob%2Fgithub-actions-snippets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoderrob%2Fgithub-actions-snippets/lists"}