Skip to content

Commit 718fc3f

Browse files
authored
Merge pull request #59 from semantic-release/actions
2 parents de25b78 + 1cf6eb4 commit 718fc3f

11 files changed

+16107
-45
lines changed

.github/workflows/release.yml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Release
2+
"on":
3+
push:
4+
branches:
5+
- master
6+
- next
7+
- beta
8+
- "*.x"
9+
permissions:
10+
contents: read # for checkout
11+
jobs:
12+
release:
13+
permissions:
14+
contents: write # to be able to publish a GitHub release
15+
issues: write # to be able to comment on released issues
16+
pull-requests: write # to be able to comment on released pull requests
17+
id-token: write # to enable use of OIDC for npm provenance
18+
name: release
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
22+
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
23+
with:
24+
cache: npm
25+
node-version: lts/*
26+
- run: npm clean-install
27+
- run: npm audit signatures
28+
# pinned version updated automatically by Renovate.
29+
# details at https://semantic-release.gitbook.io/semantic-release/usage/installation#global-installation
30+
- run: npx [email protected]
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
NPM_TOKEN: ${{ secrets.SEMANTIC_RELEASE_BOT_NPM_TOKEN }}

.github/workflows/test.yml

+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
# renovate/** branches are generated by https://github.com/apps/renovate
8+
- renovate/**
9+
10+
pull_request:
11+
types:
12+
- opened
13+
- synchronize
14+
15+
permissions:
16+
contents: read # to fetch code (actions/checkout)
17+
18+
env:
19+
FORCE_COLOR: 1
20+
NPM_CONFIG_COLOR: always
21+
22+
jobs:
23+
# verify against ranges defined as supported in engines.node
24+
test_matrix:
25+
strategy:
26+
matrix:
27+
node-version:
28+
- 18.17
29+
- 20.6.1
30+
- 20
31+
- 21
32+
33+
runs-on: ubuntu-latest
34+
35+
steps:
36+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
37+
- name: Use Node.js ${{ matrix.node-version }}
38+
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
39+
with:
40+
node-version: ${{ matrix.node-version }}
41+
cache: npm
42+
- run: npm clean-install
43+
# - run: npm audit signatures
44+
- run: npm test
45+
46+
# verify against the node version defined for development in the .nvmrc
47+
test_dev:
48+
runs-on: ubuntu-latest
49+
50+
steps:
51+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
52+
- name: Use Node.js from .nvmrc
53+
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
54+
with:
55+
node-version-file: .nvmrc
56+
cache: npm
57+
- run: npm clean-install
58+
- run: npm audit signatures
59+
- run: npm test
60+
61+
# separate job to set as required in branch protection,
62+
# as the build names above change each time Node versions change
63+
test:
64+
runs-on: ubuntu-latest
65+
needs:
66+
- test_dev
67+
- test_matrix
68+
if: ${{ !cancelled() }}
69+
steps:
70+
- name: All matrix versions passed
71+
if: ${{ !(contains(needs.*.result, 'failure')) }}
72+
run: exit 0
73+
- name: Some matrix version failed
74+
if: ${{ contains(needs.*.result, 'failure') }}
75+
run: exit 1

.gitignore

+1-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
.LSOverride
2323

2424
# Icon must end with two \r
25-
Icon
25+
Icon
2626

2727
# Thumbnails
2828
._*
@@ -128,4 +128,3 @@ $RECYCLE.BIN/
128128
# End of https://www.gitignore.io/api/macos,windows,linux,node
129129

130130
yarn.lock
131-
package-lock.json

.npmrc

-1
This file was deleted.

.nvmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
20

.travis.yml

-29
This file was deleted.

.yarnrc

-1
This file was deleted.

README.md

+10-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22

33
Parser for [Github](https://github.com), [GitLab](https://gitlab.com) and [Bitbucket](https://bitbucket.org) issues actions, references and mentions
44

5-
[![Travis](https://img.shields.io/travis/pvdlg/issue-parser.svg)](https://travis-ci.org/pvdlg/issue-parser)
6-
[![Codecov](https://img.shields.io/codecov/c/github/pvdlg/issue-parser.svg)](https://codecov.io/gh/pvdlg/issue-parser)
7-
[![Greenkeeper badge](https://badges.greenkeeper.io/pvdlg/issue-parser.svg)](https://greenkeeper.io)
5+
<!--status-badges start -->
6+
7+
[![Node CI Workflow Status][github-actions-ci-badge]][github-actions-ci-link]
8+
9+
<!--status-badges end -->
810

911
The parser can identify:
1012
- GitHub [closing keywords](https://help.github.com/articles/closing-issues-using-keywords), [duplicate keyword](https://help.github.com/articles/about-duplicate-issues-and-pull-requests), [issue references](https://guides.github.com/features/issues/#notifications) and [user mentions](https://guides.github.com/features/issues/#notifications)
@@ -438,3 +440,8 @@ Each reference has the following properties:
438440
| slug | `String` | The repository owner and name, for issue referred as `<owner>/<repo>#<issue number>`. |
439441
| prefix | `String` | The prefix used to identify the issue. |
440442
| issue | `String` | The issue number. |
443+
444+
445+
[github-actions-ci-link]: https://github.com/semantic-release/issue-parser/actions?query=workflow%3A%22Test%22+branch%3Amaster
446+
447+
[github-actions-ci-badge]: https://github.com/semantic-release/issue-parser/workflows/Test/badge.svg

index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ function buildMentionsRegexp({mentionsPrefixes}) {
4747

4848
function buildRefRegexp({actions, delimiters, issuePrefixes, issueURLSegments, hosts}) {
4949
return `(?:(?:[^\\w\\n\\v\\r]|^)+(${join(
50-
[].concat(...Object.keys(actions).map(key => actions[key]))
50+
Object.keys(actions).flatMap(key => actions[key])
5151
)}))?(?:[^\\w\\n\\v\\r]|^|(?: |\\t)*(?:${join([' ', '\t', ...delimiters])})(?: |\\t)*)${
5252
hosts.length > 0 ? `(?:${join(hosts)})?` : ''
5353
}((?:(?:[\\w-\\.]+)\\/)+(?:[\\w-\\.]+))?(${join([...issuePrefixes, ...issueURLSegments])})(\\d+)(?!\\w)`;

0 commit comments

Comments
 (0)