Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

actions-toolkit

Package Overview
Dependencies
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

actions-toolkit - npm Package Compare versions

Comparing version 2.1.0 to 2.2.0

bin/template/action.yml

18

bin/create-action.js

@@ -96,2 +96,18 @@ const fs = require('fs')

/**
* Creates a action.yml contents string, replacing variables in the action.yml template
* with values passed in by the user from the CLI prompt.
*
* @param {PromptAnswers} answers The CLI prompt answers.
* @returns {Promise<string>} The action.yml contents.
*/
async function createActionYaml (answers) {
const template = await readTemplate('action.yml')
return template
.replace(':NAME', answers.name)
.replace(':DESCRIPTION', answers.description)
.replace(':ICON', answers.icon)
.replace(':COLOR', answers.color)
}
/**
* Creates an index.test.js contents string, replacing variables in the index.test.js template

@@ -174,2 +190,3 @@ * with values passed in by the user from the CLI prompt.

// Create the templated files
const actionYaml = await createActionYaml(metadata)
const dockerfile = await createDockerfile(metadata)

@@ -183,2 +200,3 @@ const indexTest = await createIndexTest(metadata)

['Dockerfile', dockerfile],
['action.yml', actionYaml],
['index.js', entrypoint],

@@ -185,0 +203,0 @@ ['index.test.js', indexTest]

6

package.json
{
"name": "actions-toolkit",
"version": "2.1.0",
"version": "2.2.0",
"description": "A toolkit for building GitHub Actions in Node.js",

@@ -10,2 +10,6 @@ "main": "./lib/index.js",

},
"files": [
"/bin",
"/lib"
],
"scripts": {

@@ -12,0 +16,0 @@ "build": "rimraf lib && tsc -p tsconfig.json",

8

README.md

@@ -11,9 +11,9 @@ <h3 align="center">GitHub Actions Toolkit</h3>

<p align="center"><a href="https://npmjs.com/package/actions-toolkit"><img src="https://img.shields.io/npm/v/actions-toolkit/latest.svg" alt="NPM"></a> <a href="https://travis-ci.com/JasonEtco/actions-toolkit"><img src="https://badgen.now.sh/travis/JasonEtco/actions-toolkit" alt="Build Status"></a> <a href="https://codecov.io/gh/JasonEtco/actions-toolkit/"><img src="https://badgen.now.sh/codecov/c/github/JasonEtco/actions-toolkit" alt="Codecov"></a></p>
<p align="center"><a href="https://github.com/JasonEtco/actions-toolkit"><img alt="GitHub Actions status" src="https://github.com/JasonEtco/actions-toolkit/workflows/Node%20CI/badge.svg"></a> <a href="https://travis-ci.com/JasonEtco/actions-toolkit"><img src="https://badgen.now.sh/travis/JasonEtco/actions-toolkit" alt="Build Status"></a> <a href="https://codecov.io/gh/JasonEtco/actions-toolkit/"><img src="https://badgen.now.sh/codecov/c/github/JasonEtco/actions-toolkit" alt="Codecov"></a></p>
**Heads up!** This toolkit was built to work with Actions v1. There is [an official toolkit](https://github.com/actions/toolkit) for [Actions v2](https://github.blog/2019-08-08-github-actions-now-supports-ci-cd/) that you should check out. This one _may_ work for v2, but is not guaranteed, and will likely be deprecated in the near future.
## Motivation
**actions-toolkit** is a wrapper around some fantastic open source libraries, and provides some helper methods for dealing with the GitHub Actions runtime. Actios all run in Docker containers, so this library aims to help you focus on your code and not the runtime. You can learn more about [building Actions in Node.js](https://jasonet.co/posts/building-github-actions-in-node/) to get started!
**actions-toolkit** is a wrapper around some fantastic open source libraries, and provides some helper methods for dealing with the GitHub Actions runtime. Actions all run in Docker containers, so this library aims to help you focus on your code and not the runtime. You can learn more about [building Actions in Node.js](https://jasonet.co/posts/building-github-actions-in-node/) to get started!

@@ -47,2 +47,3 @@ After building a GitHub Action in Node.js, it was clear to me that I was writing code that other actions will want to use. Reading files from the repository, making requests to the GitHub API, or running arbitrary executables on the project, etc.

├── Dockerfile
├── action.yml
├── index.js

@@ -137,2 +138,3 @@ ├── index.test.js

```
See [https://github.com/octokit/graphql.js](https://github.com/octokit/graphql.js) for more details on how to leverage the GraphQL API.

@@ -139,0 +141,0 @@ <br>

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc