Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/chlbri/publish-npm-command-action

generate command for public action on npm
https://github.com/chlbri/publish-npm-command-action

github-action npm

Last synced: about 1 month ago
JSON representation

generate command for public action on npm

Awesome Lists containing this project

README

        


typescript-action status

# Generates a npm command and change package version

For commit publishing.
It looks at your commit, change your package version with the start of your commit subject ("major", "minor", "patch").
Also the action generates a npm publish command for beta an aplha version. Also at the beginning of your last commit, if you write "beta" or "alpha",
it will generate "npm publish --access public --{beta/alpha}".

NB: Don't forget to configure your CI environment with actions/setup according to your will.


## Input Parameters

You can set any or all of the following input parameters :

|Name |Type |Default |Description |
|----------------------|-------- |----------------------------|--------------------------------------------------------|
|`path` |string |optional |The package.json file path. (absolute). Use process.cwd |


## Output Variables

npm-publish-command exposes the generated command and the version created.

```yaml
steps:
- id: publish
uses: bemedev/[email protected]
with:
path: ./package.test.json

- Show version
run: |
echo "Version changed: ${{ steps.publish.outputs.version }}"

- Show command
run: |
echo "The generated npm command: ${{ steps.publish.outputs.command }}"
```


| Variable | Type | Description |
----------------|---------|------------------------------------------------------------------- |
| `command` | string | The command to excute |
| `version` | string | The version of the package |