Skip to content

Commit

Permalink
feat: include main branch by default, update input casing
Browse files Browse the repository at this point in the history
BREAKING CHANGE: All inputs are using kebab case rather than snake.
Simply update the following inputs if you are using them:

- `additional_packages` -> `additional-packages`
- `dry_run` -> `dry-run`
- `repository_url` -> `repository-url`
- `tag_format` -> `tag-format`
  • Loading branch information
codfish committed Nov 9, 2023
1 parent f712bd4 commit ad7eb9d
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 53 deletions.
22 changes: 3 additions & 19 deletions .github/workflows/validate.yml
Expand Up @@ -38,10 +38,10 @@ jobs:
prerelease: true
}
]
repository_url: https://github.com/codfish/semantic-release-action.git
tag_format: 'v${version}'
repository-url: https://github.com/codfish/semantic-release-action.git
tag-format: 'v${version}'
extends: '@semantic-release/apm-config'
additional_packages: |
additional-packages: |
['@semantic-release/apm', '@semantic-release/git']
plugins: |
['@semantic-release/commit-analyzer', '@semantic-release/release-notes-generator', '@semantic-release/github', '@semantic-release/apm', '@semantic-release/git']
Expand All @@ -52,22 +52,6 @@ jobs:
- name: semantic-release with no inputs
id: semantic
uses: ./
with:
branches: |
[
'+([0-9])?(.{+([0-9]),x}).x',
'main',
'next',
'next-major',
{
name: 'beta',
prerelease: true
},
{
name: 'alpha',
prerelease: true
}
]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down
32 changes: 16 additions & 16 deletions README.md
Expand Up @@ -217,21 +217,21 @@ defined in your repo (`.releaserc`, `release.config.js`, `release` prop in `pack
> **Note**: Each input **will take precedence** over options configured in the configuration file
> and shareable configurations.
| Input Variable | Type | Description |
| ------------------- | --------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| branches | `Array`, `String`, `Object` | The branches on which releases should happen. |
| plugins | `Array` | Define the list of plugins to use. Plugins will run in series, in the order defined, for each steps if they implement it |
| extends | `Array`, `String` | List of modules or file paths containing a shareable configuration. |
| additional_packages | `Array`, `String` | Define a list of additional plugins/configurations (official or community) to install. Use this if you 1) use any plugins other than the defaults, which are already installed along with semantic-release or 2) want to extend from a shareable configuration. |
| dry_run | `Boolean` | The objective of the dry-run mode is to get a preview of the pending release. Dry-run mode skips the following steps: prepare, publish, success and fail. |
| repository_url | `String` | The git repository URL |
| tag_format | `String` | The Git tag format used by semantic-release to identify releases. |

> **Note**: Any package specified in `extends` or `additional_packages` will be installed
| Input Variable | Type | Description | Default |
| --------------------- | --------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| `branches` | `Array`, `String`, `Object` | The branches on which releases should happen. Our default mimic's semantic-release's, with one major inclusion: the `main` branch. | `['+([0-9])?(.{+([0-9]),x}).x', 'master', 'main', 'next', 'next-major', {name: 'beta', prerelease: true}, {name: 'alpha', prerelease: true}]` |
| `plugins` | `Array` | Define the list of plugins to use. Plugins will run in series, in the order defined, for each steps if they implement it | [Semantic default](https://github.com/semantic-release/semantic-release/blob/master/docs/usage/configuration.md#plugins) |
| `extends` | `Array`, `String` | List of modules or file paths containing a shareable configuration. | [Semantic default](https://github.com/semantic-release/semantic-release/blob/master/docs/usage/configuration.md#extends) |
| `additional-packages` | `Array`, `String` | Define a list of additional plugins/configurations (official or community) to install. Use this if you 1) use any plugins other than the defaults, which are already installed along with semantic-release or 2) want to extend from a shareable configuration. | `[]` |
| `dry-run` | `Boolean` | The objective of the dry-run mode is to get a preview of the pending release. Dry-run mode skips the following steps: prepare, publish, success and fail. | [Semantic default](https://github.com/semantic-release/semantic-release/blob/master/docs/usage/configuration.md#dryrun) |
| `repository-url` | `String` | The git repository URL | [Semantic default](https://github.com/semantic-release/semantic-release/blob/master/docs/usage/configuration.md#repositoryurl) |
| `tag-format` | `String` | The Git tag format used by semantic-release to identify releases. | [Semantic default](https://github.com/semantic-release/semantic-release/blob/master/docs/usage/configuration.md#tagformat) |

> **Note**: Any package specified in `extends` or `additional-packages` will be installed
> automatically for you as a convenience, allowing you to use this action without adding new
> dependencies to your application or install deps in a separate action step.
> **Note**: `additional_packages` won't get used automatically, setting this variable will just
> **Note**: `additional-packages` won't get used automatically, setting this variable will just
> install them so you can use them. You'll need to actually list them in your `plugins` and/or
> `extends` configuration for **semantic-release** to use them.
Expand All @@ -250,7 +250,7 @@ defined in your repo (`.releaserc`, `release.config.js`, `release` prop in `pack
steps:
- run: codfish/semantic-release-action@v2
with:
dry_run: true
dry-run: true
branches: |
[
'+([0-9])?(.{+([0-9]),x}).x',
Expand All @@ -266,10 +266,10 @@ steps:
prerelease: true
}
]
repository_url: https://github.com/codfish/semantic-release-action.git
tag_format: 'v${version}'
repository-url: https://github.com/codfish/semantic-release-action.git
tag-format: 'v${version}'
extends: '@semantic-release/apm-config'
additional_packages: |
additional-packages: |
['@semantic-release/apm@4.0.0', '@semantic-release/git']
plugins: |
['@semantic-release/commit-analyzer', '@semantic-release/release-notes-generator', '@semantic-release/github', '@semantic-release/apm', '@semantic-release/git']
Expand Down
31 changes: 21 additions & 10 deletions action.yml
Expand Up @@ -12,6 +12,17 @@ inputs:
'The branches on which releases should happen.
https://github.com/semantic-release/semantic-release/blob/master/docs/usage/configuration.md#branches'
required: false
default: |
[
'master',
'main',
'next',
'next-major',
'+([0-9])?(.{+([0-9]),x}).x',
{ name: 'beta', prerelease: true },
{ name: 'alpha', prerelease: true },
{ name: 'canary', prerelease: true },
]
extends:
description:
'String or array of modules or file paths containing a shareable configuration.
Expand All @@ -23,26 +34,26 @@ inputs:
steps if they implement it.
https://github.com/semantic-release/semantic-release/blob/master/docs/usage/configuration.md#plugins'
required: false
additional_packages:
additional-packages:
description:
'Define a list of additional plugins or shareable configurations (official or community) to
install. Use this if you 1) use any plugins other than commit-analyzer,
release-notes-generator, github, or npm, which are already installed along with
semantic-release or 2) want to extend from a shareable configuration.
https://semantic-release.gitbook.io/semantic-release/extending/plugins-list'
required: false
dry_run:
dry-run:
description:
'The objective of the dry-run mode is to get a preview of the pending release. Dry-run mode
skips the following steps: prepare, publish, success and fail.
https://github.com/semantic-release/semantic-release/blob/master/docs/usage/configuration.md#dryrun'
required: false
repository_url:
repository-url:
description:
'The git repository URL.
https://github.com/semantic-release/semantic-release/blob/master/docs/usage/configuration.md#repositoryurl'
required: false
tag_format:
tag-format:
description:
'The Git tag format used by semantic-release to identify releases.
https://github.com/semantic-release/semantic-release/blob/master/docs/usage/configuration.md#tagformat'
Expand All @@ -66,17 +77,17 @@ outputs:
release-patch:
description: "The new releases' patch version number, i.e. `3`."
release-notes:
description: "The release notes of the next release."
description: 'The release notes of the next release.'
type:
description: "The semver export type of the release, e.g. `major`, `prerelease`, etc."
description: 'The semver export type of the release, e.g. `major`, `prerelease`, etc.'
channel:
description: "The release channel of the release."
description: 'The release channel of the release.'
git-head:
description: "The git hash of the release."
description: 'The git hash of the release.'
git-tag:
description: "The version with v prefix."
description: 'The version with v prefix.'
name:
description: "The release name."
description: 'The release name.'
runs:
using: 'docker'
image: 'Dockerfile'
16 changes: 8 additions & 8 deletions entrypoint.js
Expand Up @@ -51,21 +51,21 @@ async function run() {
const branches = parseInput(core.getInput('branches', { required: false }));
const plugins = parseInput(core.getInput('plugins', { required: false }));
const additionalPackages =
parseInput(core.getInput('additional_packages', { required: false })) || [];
parseInput(core.getInput('additional-packages', { required: false })) || [];
const extendsInput = parseInput(core.getInput('extends', { required: false }));
let dryRun = core.getInput('dry_run', { required: false });
let dryRun = core.getInput('dry-run', { required: false });
dryRun = dryRun !== '' ? dryRun === 'true' : '';
const repositoryUrl = core.getInput('repository_url', { required: false });
const tagFormat = core.getInput('tag_format', { required: false });
const repositoryUrl = core.getInput('repository-url', { required: false });
const tagFormat = core.getInput('tag-format', { required: false });

core.debug(`branch input: ${branch}`);
core.debug(`branches input: ${branches}`);
core.debug(`plugins input: ${plugins}`);
core.debug(`additional_packages input: ${additionalPackages}`);
core.debug(`additional-packages input: ${additionalPackages}`);
core.debug(`extends input: ${extendsInput}`);
core.debug(`dry_run input: ${dryRun}`);
core.debug(`repository_url input: ${repositoryUrl}`);
core.debug(`tag_format input: ${tagFormat}`);
core.debug(`dry-run input: ${dryRun}`);
core.debug(`repository-url input: ${repositoryUrl}`);
core.debug(`tag-format input: ${tagFormat}`);

// install additional plugins/configurations
if (extendsInput) {
Expand Down

0 comments on commit ad7eb9d

Please sign in to comment.