GitHub Action
Read package.json
v1.0.5
Latest version
Reads a package.json file and returns the contents as environment variables. Naming convention depends on the file name. For example, if the file is named package.json
, the environment variables will be prefixed with PACKAGE_
. If the file is named testing.json
, the environment variables will be prefixed with TESTING_
.
- name: Package.json info
uses: rexdefuror/[email protected]
- run: echo "name - ${{ env.PACKAGE_NAME }}"
- run: echo "version - ${{ env.PACKAGE_VERSION }}"
- run: echo "description - ${{ env.PACKAGE_DESCRIPTION }}"
- name: Package.json info
uses: rexdefuror/[email protected]
with:
file: testing.json
- run: echo "name - ${{ env.TESTING_NAME }}"
- run: echo "version - ${{ env.TESTING_VERSION }}"
- run: echo "description - ${{ env.TESTING_DESCRIPTION }}"
- name: Package.json info
uses: rexdefuror/[email protected]
with:
file: testing.json
path: ./src
- run: echo "name - ${{ env.TESTING_NAME }}"
- run: echo "version - ${{ env.TESTING_VERSION }}"
- run: echo "description - ${{ env.TESTING_DESCRIPTION }}"
Optional The name of the file to read. Default "package.json"
.
Optional The path to the file. Default "./"
.