Validates a pull request intended for creating a GitHub Release. When merged the action will then create the release.
- Trigger on PullRequestEvent with type
opened
,edited
orreopened
.- Add a label defined by
release_label
to the PR. - Validate title.
- Checks that the PR title matches the defined
release_pattern
. - If
release_pattern
is a Calver containing named capture groups<year>
,<month>
and/or<day>
it will check that the current date matches. - Check that a release with the same title does not already exist.
- Checks that the PR title matches the defined
- Validate that the PR body is not empty.
- Validates that the PR is from an allowed branch defined by
head_branch
. - If above checks fails it will review the PR and request changes.
- If above checks passes it will approve the PR.
- Add a label defined by
- Trigger on PullRequestEvent with type
closed
andmerged
.- Create a GitHub Release with the title and body of the PR. The release tag will be constructed as
tag_prefix
/release
.
- Create a GitHub Release with the title and body of the PR. The release tag will be constructed as
The GITHUB_TOKEN. See details.
The branch which the release PR will target. Defaults to master
.
The branch which the release PR originates from. Defaults to dev
.
The pattern to validate the PR title against. If it contains any of the named capture groups <year>
, <month>
and/or <day>
Calver validation will occur to ensure that the date is current.
Make sure it validates against https://regexr.com.
Defaults to ^(?<year>[0-9]{4})\.(?<month>[0-9]{2})\.(?<day>[0-9]{2})-\d$
.
The prefix to use when tagging release. Set to null or an empty string to disable tag-prefixing. Defaults to releases/
.
Apply a transform on the tag before validating and releasing it. Available choices: "title", "dashes-and-number".
The default is title
, which supplies the PR title as is.
When using dashes-and-number
, a PR with number 32 and title "Fix thing" becomes #32-fix-thing
.
Sets if a PR should just be commented upon or approved and request changes depending on the success of validation. Accepts true
or false
. Defaults to true
.
The label to add to the release PR. Set to an empty string to disable. Defaults to release
.
Creates a prerelease instead. Defaults to false
.
Validate name and description of PR according to provided input. Defaults to true
.
Sets if a GitHub status should
be created by the action. This is useful when wanting to restrict merging until the action runs successfully. Since GitHub creates a
check on the PR for every PR event that triggers the action isn't useful to restrict merging by the action checks. Instead use this status specified by status_name
.
Defaults to true
.
The name of the status created when create_status
is set to true
. Defaults to Monkey Release
.
Message to comment with on valid release PRs. Can be overridden to add custom
cheerfulness or reminders. Defaults to Valid release 🍌
.
The release title.
on:
pull_request:
types: [opened, reopened, edited, closed]
branches:
- master
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: 5monkeys/monkey-release-action@master
id: release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
base_branch: master
head_branch: dev
tag_prefix: releases/
approve_releases: true
release_label: release
- Install deps:
npm ci
- Run tests:
npm run test
- Run lint:
npm run lint
- Package application
npm run package
. Remember to run this before committing anything.