npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@teamhive/core-actions

v7.0.1

Published

This library contains private GitHub Actions for TeamHive monorepos.

Downloads

134

Readme

@teamhive/core-actions

This library contains private GitHub Actions for TeamHive monorepos.

Actions

Usage

Installation

To use actions, install the package with npm or as a dev dependency

yarn add @teamhive/core-actions --dev
npm i --save-dev @teamhive/core-actions

After installation, this will create a folder relative to the root of the directory at .github/actions/core-actions. Our recommendation is that this folder should be treated like compiled code. You should not edit the code in this folder as it will be overridden on a re-installation or update of the package. Additionally, the folder should be gitignored. This will prevent the action from being run without installing the package first in the GitHub Actions container.

Calling actions

In a workflow yml file, you can use a relative path from the root of the repository to reference the actions in the core-actions directory.

Example:

- name: Build Apps
    uses: ./.github/actions/core-actions/build-node-apps
    with:
        dockerBuildArgs: '["--build-arg", "TAG=loop-lxp-deps"]'
        environment: 'next'
        ecrRegistry: ${{ steps.login-ecr.outputs.registry }}

Contributing

To create a new action, create a new folder in the src/actions directory with the name of the action in kebab case. Within that directory, create an action.yml file and named for the action, such as action-name.action.ts. In action.yml, you define and document all of the inputs of an action following the specifications given by GitHub. This action.yml will be copied into the .github/actions/core-actions folder upon installation.

Action Class

To implement your action you must create and export a class that extends AbstractAction. This class should define an async run function, as well as define its actionName and dirName. If the action has inputs, you should define the arguments for the action as well.

Action Arguments

The arguments for an action are typed through a static class. This has the benefit of providing a type abstraction on top of the core.getInput function. To create an argument class, simply create a class with static properties and decorate them with the @ActionArg() decorator.

Example

// hello.action.ts
import { AbstractAction } from '../../classes';
import { ActionNames } from '../../constants';
import { Action } from '../../decorator';
import { HelloArg } from './hello-args;

@Action()
export class HelloAction extends AbstractAction {
    static actionName: ActionNames = 'Hello';
    static dirName: string = __dirname;

    args: typeof HelloArgs = HelloArgs;

    async run() {
        console.log(`Hello, ${this.args.name}`);
    }
}
// hello.args.ts
import { ActionArg } from '../../decorator/action-arg.dec';

export class BuildNodeAppsArgs {
    @ActionArg()
    static name: string;
}