Socket
Socket
Sign inDemoInstall

@penfold/github-actions-include

Package Overview
Dependencies
28
Maintainers
2
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @penfold/github-actions-include

> Simple but effective partials system for GitHub Actions


Version published
Weekly downloads
506
increased by16.86%
Maintainers
2
Install size
1.28 MB
Created
Weekly downloads
 

Readme

Source

github-actions-include

Simple but effective partials system for GitHub Actions

What it does

Compiles GitHub Actions workflows with "partials", ie. partial workflow YAML configuration, using an #!include(partial_name) directive.

Example

Workflow:

# github/workflows/cleanup.yml
name: Cleanup
on: [push]
jobs:
  #!include(setup_environment)

Partial:

# github/partials/setup_environment.yml
setup_env:
    name: Setup environment
    runs-on: ubuntu-latest
    steps: 
        # ...

Result:

# .github/workflows/cleanup.yml
name: Cleanup
on: [push]
jobs:
  setup_env:
    name: Setup environment
    runs-on: ubuntu-latest
    steps: 
        # ...

Requirements

  • Husky: https://github.com/typicode/husky

Install

NPM:

npm install --dev @penfold/github-actions-include

Yarn:

yarn add --dev @penfold/github-actions-include

CLI Usage

$ github-actions-include --help
Options:
  --help                  Show help                                    [boolean]
  --version               Show version number                          [boolean]
  --partialsDir           Path to partials                              [string]
  --workflowsDir          Path to workflows (must not be .github/workflows)
                                                             [string] [required]
  --includeWarningReadme  Include warning README.md in .github/workflows
                                                       [boolean] [default: true]

API Usage

const githubActionsInclude = require("github-actions-include");

// Options object and all fields are optional
githubActionsInclude({
  workflowsDir: "github/workflows",
  partialsDir: "github/partials",
  includeWarningReadme: true,
});

Options

workflowsDir

Default: github/workflows

The folder in your project where you will write your GH Actions workflows.

Cannot be .github/workflows.

partialsDir

Default: github/partials

The folder in your project where you will write your GH Actions partials.

includeWarningReadme

Default: true

Whether to include a warning README in .github/workflows that tells developers not to make changes in that folder, but in the folder specified by workflowsDir.

License

Create by Penfold and released under the MIT license.

FAQs

Last updated on 13 Jun 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc