Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Dead simple rust CLI to ease workflows management inside monorepos.

NotificationsYou must be signed in to change notification settings

rawnly/hawk

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

75 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dead simple rust CLI to ease workflows management inside monorepos.

gif

Installation

You can installhawk via cargo (homebrew coming soon) or by downloading thelatest binary

cargo install hawk-cli

Usage

Runhawk init to initialize an empty config file. With the--read-from-env flaghawk will try toretrive yourworkspaces frompnpm-workspace.yaml orpacakge.json workspaces key.You can also pass--json if you want to save the config file as json.

hawk 0.1.4USAGE:    hawk [OPTIONS] [SUBCOMMAND]OPTIONS:    -c, --config<CONFIG>    Specify the config file path    -h, --help               Printhelp information        --scope<SCOPE>      Specify which workspaces files copy / watch Usage: --scope<workspace-name>    -V, --version            Print version informationSUBCOMMANDS:    clean    Delete generated files    copy     Copy files to the`target` directoryhelp     Print this message or thehelp of the given subcommand(s)    init     Initialize a repository    list     List workflowsin the`target` directory

Example

Check out theexample folder.

Below an example monorepo situation:

example├── hawk-config.yaml├── .github│   └── workflows│       ├── my-second-app--deploy.yml# name generated by folder│       └── the-app--deploy.yml# name is read from package.json└── packages    ├── my-app    │   ├── .DS_Store    │   ├── package.json // reads workspace name from package.json (the-app)    │   └── .github/workflows    │       └── deploy.yml    └── my-second-app        └── .github/workflows            └── deploy.yml
    $cd example    $ hawk --watch    ...let the magic happen

Why

Github actions don't yet support workflows inside subfolders, neither in your.github/workflows/ folder or project custom folders.So I madehawk to solve this problem without using custom commands. It lets you copy workflows from custom paths and paste them with a prefix, handling most of the pain.With 10 lines config you have a working monorepo setup.

Installation

Download thelatest release and move in your$PATH

From source

make sure to have your rust environment ready, then:

  • Clone the repo
  • Runcargo build -r ormake build
  • Copytarget/release/hawk to your path or usesudo make install (it will copy the bin into/usr/local/bin)
  • Enjoy

Setup

To setup a new project just runhawk init. If you're in anode environment you can pass the--read-from-env flag to generate config based on the monorepo configuration.

Run in the CI

-uses:rawnly/hawk@mainwith:config:hawk-config.yaml

Features

  • File watching
  • Cleanupworkflows folder from generated files.
  • Custom configuration
  • Generate config frompnpm-workspace.yaml and yarnspackage.json:workspaces
  • Create an action to automate this process. (so the user can update a workflow, push and get the generated one updated automatically)

[8]ページ先頭

©2009-2025 Movatter.jp