Skip to content

Latest commit

 

History

History
47 lines (36 loc) · 1.57 KB

README.md

File metadata and controls

47 lines (36 loc) · 1.57 KB

info-from-package-json-action

Build and Test

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

- name: Retrieve information from package.json
  uses: myrotvorets/[email protected]
  id: ver

It can be useful, for example, together with sonarcloud-github-action:

- 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 }}