Giter Club home page Giter Club logo

github-action-package's Introduction

github-action-package

Buy me a coffee CI

Read and modify the contents of package.json.

Example Usage

- name: package.json info
  id: info
  uses: jaywcjlove/github-action-package@main

- run: echo "name - ${{ steps.info.outputs.name }}"
- run: echo "version - ${{ steps.info.outputs.version }}"
- run: echo "description - ${{ steps.info.outputs.description }}"
- run: echo "author - ${{ steps.info.outputs.author }}"
- name: package.json info
  id: info
  uses: jaywcjlove/github-action-package@main
  with:
    data: |
      {
        "name": "@jaywcjlove/github-action-package-test"
      }

- run: echo "name - ${{ steps.info.outputs.name }}"
- run: echo "version - ${{ steps.info.outputs.version }}"
- run: echo "description - ${{ steps.info.outputs.description }}"
- run: echo "author - ${{ steps.info.outputs.author }}"
- name: package.json info
  id: info
  uses: jaywcjlove/github-action-package@main
  with:
    rename: '@jaywcjlove/github-action-package-test'

- run: echo "name - ${{ steps.info.outputs.name }}"
- run: echo "version - ${{ steps.info.outputs.version }}"
- run: echo "description - ${{ steps.info.outputs.description }}"
- run: echo "author - ${{ steps.info.outputs.author }}"

delete nested values

{
  "name": "github-action-package",
  "author": "jaywcjlove",
  "repository": {
    "type": "git",
    "url": "https://github.com/jaywcjlove/github-action-package"
  },
  "keywords": [
    "actions",
    "package"
  ]
}
- name: package.json info
  uses: jaywcjlove/github-action-package@main
  with:
    unset: repository.type,repository.url,keywords

Output:

{
  "name": "github-action-package",
  "author": "jaywcjlove",
  "repository": {}
}

Inputs

  • path The path of the package.json file. Default: package.json
  • data json data for changing package.json. Default: {}
  • rename Used to change "name" data in "package.json".
  • version Used to change "version" data in "package.json".
  • description Used to change "description" data in "package.json".
  • unset delete "Object" nested values in "package.json".

Output Parameters

  • name The name of the package.
  • description This helps people discover your package, as it's listed in 'npm search'.
  • version Version must be parseable by node-semver, which is bundled with npm as a dependency.
  • homepage The url to the project homepage.
  • author author field in package.json
  • private private field in package.json
  • license You should specify a license for your package so that people know how they are permitted to use it, and any restrictions you're placing on it.
  • author This helps people discover your package as it's listed in 'npm search'.
  • keywords This helps people discover your package as it's listed in 'npm search'.
  • repository Specify the place where your code lives. This is helpful for people who want to contribute.
  • os Specify which operating systems your module will run on.
  • cpu cpu field in package.json

See Also

Contributors

As always, thanks to our amazing contributors!

Made with action-contributors.

License

Licensed under the MIT License.

github-action-package's People

Contributors

jaywcjlove avatar renovate[bot] avatar drewloomer avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.