Skip to content

Commit

Permalink
Post comment on any issues that were closed by PRs included in release (
Browse files Browse the repository at this point in the history
#120)

* wip

* remove console log

* refactor issue listing for notifications; include package name and version in release step

* linting

* fix release test

* only run notify on issue when enabled

* load package info in code instead of action steps

* refactor promise chain to async/await

* move release note parsing into own util

* update README file

* add concurrency; reduce number of params passed around;

* use older version of pMap; turn getLinkedIssueNumbers to async;

* update release test

* releaseNotes util only return unique PR numbers; add test for release note util

* Update action.yml

Co-authored-by: Simone Busoli <simone.busoli@gmail.com>

* add coverae thresholds

* update dependency

* use pMap; use positional args;

* rename notify-on-the-issue to notify-linked-issues

* wip

* update README

* remove redundant config entries

* update test lib configs

* write tests for notifyIssue

* format test string

* format test string

* move callbacks inline

* refactor how the package info is loaded

* revert package info refactoring

* linting

Co-authored-by: Dénes Fekésházy <denes.fekeshazy@nearform.com>
Co-authored-by: Dénes Fekésházy <95295549+denes-fekeshazy@users.noreply.github.com>
Co-authored-by: Simone Busoli <simone.busoli@gmail.com>
  • Loading branch information
4 people committed Jun 24, 2022
1 parent 0381b45 commit 0071d34
Show file tree
Hide file tree
Showing 12 changed files with 13,086 additions and 11,217 deletions.
9 changes: 4 additions & 5 deletions .taprc
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
ts: false
jsx: false
flow: false
check-coverage: false
coverage: true
statements: 80
lines: 80
functions: 75
branches: 80
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This action allows you to automate the release process of your npm modules, apps
## What does it do?

- When run, it opens a new PR for the release.
- When/if the PR gets merged, it publishes a new Npm release and a new GitHub release with change logs
- When/if the PR gets merged, it publishes a new Npm release, a new GitHub release with change logs and it adds a comment for each issues linked to the release with links to the release deatils. This feature can be turned off by the `notify-linked-issues` flag.

You can also use it for releases without Npm. In that case, when the PR merges, a new GitHub release will be published. Which you can use to trigger another workflow that deploys the app somewhere (GCP, AWS etc).

Expand Down Expand Up @@ -81,6 +81,7 @@ When you merge this PR:
- _(Optional)_ You can define Npm and Optic tokens in GitHub secrets for each user that will receive the OTP. This is required only in case you want to publish to Npm.
- Upon successful retrieval of the OTP, it will publish the package to Npm.
- Create a Github release with change logs (You can customize release notes using [release.yml](https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes#example-configuration))
- Leave a comment on each issues that are linked to the pull reqeuests of this release. This feature can be turned off by the `notify-on-the-issue` flag.

When you close the PR without merging it: nothing will happen.

Expand Down Expand Up @@ -186,6 +187,7 @@ jobs:
| `build-command`| No | An optional build commit to run after the version bump and before releasing the package |
| `api-url` | No | GitHub App URL. You wouldn't need to set this unless you're deploying a custom GitHub app instead of [optic-release-automation](https://github.com/apps/optic-release-automation). <br /> (_Default: `https://optic-release-automation-ocrlhra4va-ue.a.run.app/`_) |
| `sync-semver-tags`| No | If you want to keep the major and minor versions git tags synced to the latest appropriate commit <br /> (_Default: `false`_) |
| `notify-linked-issues`| No | An optional flag to enable an automatic comment on all issues linked to each release so that people following those issues get notified of the code being released. <br /> (_Default: `true`_) |

## Motivation

Expand Down
5 changes: 5 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ inputs:
required: false
type: boolean
default: 'false'
notify-linked-issues:
description: 'If the flag is set to "true", a comment will be posted on each issue that is linked to the pull requests included in each release. The default setting is "true".'
required: false
type: boolean
default: 'true'

runs:
using: 'composite'
Expand Down

0 comments on commit 0071d34

Please sign in to comment.