Skip to content

Commit

Permalink
Merge pull request #59 from semantic-release/actions
Browse files Browse the repository at this point in the history
  • Loading branch information
travi authored Mar 14, 2024
2 parents de25b78 + 1cf6eb4 commit 718fc3f
Show file tree
Hide file tree
Showing 11 changed files with 16,107 additions and 45 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Release
"on":
push:
branches:
- master
- next
- beta
- "*.x"
permissions:
contents: read # for checkout
jobs:
release:
permissions:
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
id-token: write # to enable use of OIDC for npm provenance
name: release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
cache: npm
node-version: lts/*
- run: npm clean-install
- run: npm audit signatures
# pinned version updated automatically by Renovate.
# details at https://semantic-release.gitbook.io/semantic-release/usage/installation#global-installation
- run: npx [email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.SEMANTIC_RELEASE_BOT_NPM_TOKEN }}
75 changes: 75 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Test

on:
push:
branches:
- master
# renovate/** branches are generated by https://github.com/apps/renovate
- renovate/**

pull_request:
types:
- opened
- synchronize

permissions:
contents: read # to fetch code (actions/checkout)

env:
FORCE_COLOR: 1
NPM_CONFIG_COLOR: always

jobs:
# verify against ranges defined as supported in engines.node
test_matrix:
strategy:
matrix:
node-version:
- 18.17
- 20.6.1
- 20
- 21

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: ${{ matrix.node-version }}
cache: npm
- run: npm clean-install
# - run: npm audit signatures
- run: npm test

# verify against the node version defined for development in the .nvmrc
test_dev:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Use Node.js from .nvmrc
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version-file: .nvmrc
cache: npm
- run: npm clean-install
- run: npm audit signatures
- run: npm test

# separate job to set as required in branch protection,
# as the build names above change each time Node versions change
test:
runs-on: ubuntu-latest
needs:
- test_dev
- test_matrix
if: ${{ !cancelled() }}
steps:
- name: All matrix versions passed
if: ${{ !(contains(needs.*.result, 'failure')) }}
run: exit 0
- name: Some matrix version failed
if: ${{ contains(needs.*.result, 'failure') }}
run: exit 1
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
.LSOverride

# Icon must end with two \r
Icon
Icon

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

yarn.lock
package-lock.json
1 change: 0 additions & 1 deletion .npmrc

This file was deleted.

1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20
29 changes: 0 additions & 29 deletions .travis.yml

This file was deleted.

1 change: 0 additions & 1 deletion .yarnrc

This file was deleted.

13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

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

[![Travis](https://img.shields.io/travis/pvdlg/issue-parser.svg)](https://travis-ci.org/pvdlg/issue-parser)
[![Codecov](https://img.shields.io/codecov/c/github/pvdlg/issue-parser.svg)](https://codecov.io/gh/pvdlg/issue-parser)
[![Greenkeeper badge](https://badges.greenkeeper.io/pvdlg/issue-parser.svg)](https://greenkeeper.io)
<!--status-badges start -->

[![Node CI Workflow Status][github-actions-ci-badge]][github-actions-ci-link]

<!--status-badges end -->

The parser can identify:
- 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)
Expand Down Expand Up @@ -438,3 +440,8 @@ Each reference has the following properties:
| slug | `String` | The repository owner and name, for issue referred as `<owner>/<repo>#<issue number>`. |
| prefix | `String` | The prefix used to identify the issue. |
| issue | `String` | The issue number. |


[github-actions-ci-link]: https://github.com/semantic-release/issue-parser/actions?query=workflow%3A%22Test%22+branch%3Amaster

[github-actions-ci-badge]: https://github.com/semantic-release/issue-parser/workflows/Test/badge.svg
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function buildMentionsRegexp({mentionsPrefixes}) {

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

0 comments on commit 718fc3f

Please sign in to comment.