Home

Awesome

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

Output Parameters

See Also

Contributors

As always, thanks to our amazing contributors!

<a href="https://github.com/jaywcjlove/github-action-package/graphs/contributors"> <img src="https://jaywcjlove.github.io/github-action-package/CONTRIBUTORS.svg" /> </a>

Made with action-contributors.

License

Licensed under the MIT License.