Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/myrotvorets/info-from-package-json-action
Gathers some information from package.json to make it available to other actions.
https://github.com/myrotvorets/info-from-package-json-action
github-action github-actions package-json
Last synced: about 1 month ago
JSON representation
Gathers some information from package.json to make it available to other actions.
- Host: GitHub
- URL: https://github.com/myrotvorets/info-from-package-json-action
- Owner: myrotvorets
- License: mit
- Created: 2020-10-10T09:36:52.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2024-10-29T15:11:58.000Z (about 2 months ago)
- Last Synced: 2024-10-29T17:24:11.762Z (about 2 months ago)
- Topics: github-action, github-actions, package-json
- Language: TypeScript
- Homepage:
- Size: 2.8 MB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# info-from-package-json-action
![Build and Test](https://github.com/myrotvorets/info-from-package-json-action/workflows/Build%20and%20Test/badge.svg)
This action gathers some information from `package.json` to make it available to other actions.
## Inputs
* `workingdir`: Directory with package.json (default: current working directory)
## Outputs
* `packageName`: `name` from `package.json`
* `packageVersion`: `version` from `package.json`
* `packageDescription`: `description` from `package.json`
* `packageHomepage`: `homepage` from `package.json`
* `packageBugsUrl`: `bugs.url` from `package.json`
* `packageScmUrl`: `repository.url` from `package.json`## Example usage
```yaml
- name: Retrieve information from package.json
uses: myrotvorets/[email protected]
id: ver
```It can be useful, for example, together with [sonarcloud-github-action](https://github.com/SonarSource/sonarcloud-github-action):
```yaml
- name: Retrieve information from package.json
uses: myrotvorets/[email protected]
id: ver- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
args: >
-Dsonar.projectName=${{ steps.ver.outputs.packageName }}
-Dsonar.projectVersion=${{ steps.ver.outputs.packageVersion }}
-Dsonar.links.homepage=${{ steps.ver.outputs.packageHomepage }}
-Dsonar.links.issue=${{ steps.ver.outputs.packageBugsUrl }}
-Dsonar.links.scm=${{ steps.ver.outputs.packageScmUrl }}
```