Skip to content

Commit

Permalink
Handle first release, document (#6)
Browse files Browse the repository at this point in the history
* Handle first release, document

Closes #3

* run build
  • Loading branch information
apexskier authored Oct 9, 2020
1 parent 672c389 commit 58609b0
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,10 @@ jobs:
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```
## Known limitations
These are some known limitations of this action. I'd like to try to address them in the future.
- Non-linear releases aren't supported. For example, releasing a patch to a prior major release after a new major release has been bumped.
- The first release for a project will be ignored. This is intentional, as the use case is unlikely. Most projects will either have several alphas that don't need release comments, or won't use issues/PRs for the first commit.
8 changes: 8 additions & 0 deletions dst/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,16 @@ const closesMatcher = /aria-label="This commit closes issue #(\d+)\."/g;
per_page: 2,
});

if (releases.length < 2) {
if (!releases.length) {
core.error("no releases found");
return;
}

core.info("first release");
return;
}

const [currentRelease, priorRelease] = releases;

const {
Expand Down

0 comments on commit 58609b0

Please sign in to comment.