Compare commits
26 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
58ae73b360 | ||
|
|
ffcd2d4c10 | ||
|
|
c309084e8b | ||
|
|
819589c886 | ||
|
|
6297172c9f | ||
|
|
918a7af1fe | ||
|
|
6ba4f20c9a | ||
|
|
97a630fc75 | ||
|
|
3f844db37a | ||
|
|
9e1799683e | ||
|
|
6553b535a3 | ||
|
|
132ba9b615 | ||
|
|
99014f6c59 | ||
|
|
e663819a51 | ||
|
|
69242acd76 | ||
|
|
09a8e66990 | ||
|
|
6f8234ce3e | ||
|
|
8131ae1c5d | ||
|
|
2c158d72a4 | ||
|
|
404de39364 | ||
|
|
b9600947f7 | ||
|
|
e31291f6a4 | ||
|
|
e5cc18bd59 | ||
|
|
6cddb7ed31 | ||
|
|
8d640a794c | ||
|
|
268f2377f2 |
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
@@ -11,7 +11,7 @@ jobs:
|
|||||||
check_pr:
|
check_pr:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2.4.0
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: "yarn install"
|
- name: "yarn install"
|
||||||
run: yarn install
|
run: yarn install
|
||||||
|
|||||||
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
@@ -5,7 +5,7 @@ jobs:
|
|||||||
check_pr:
|
check_pr:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2.4.0
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: "yarn install"
|
- name: "yarn install"
|
||||||
run: yarn install
|
run: yarn install
|
||||||
|
|||||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -93,3 +93,6 @@ fabric.properties
|
|||||||
.idea/**/markdown-navigator/
|
.idea/**/markdown-navigator/
|
||||||
|
|
||||||
# End of https://www.gitignore.io/api/webstorm
|
# End of https://www.gitignore.io/api/webstorm
|
||||||
|
|
||||||
|
# Coverage
|
||||||
|
coverage
|
||||||
62
README.md
62
README.md
@@ -3,36 +3,39 @@
|
|||||||
This action will create a GitHub release and optionally upload an artifact to it.
|
This action will create a GitHub release and optionally upload an artifact to it.
|
||||||
|
|
||||||
## Action Inputs
|
## Action Inputs
|
||||||
- **allowUpdates**: An optional flag which indicates if we should update a release if it already exists. Defaults to `false`.
|
| Input name | Description | Required | Default Value |
|
||||||
- **artifactErrorsFailBuild**: An optional flag which indicates if artifact read or upload errors should fail the build.
|
|----------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------|----------------------|
|
||||||
- **artifact** (deprecated): An optional set of paths representing artifacts to upload to the release. This may be a single path or a comma delimited list of paths (or globs).
|
| allowUpdates | An optional flag which indicates if we should update a release if it already exists. Defaults to false. | false | "" |
|
||||||
- **artifacts**: An optional set of paths representing artifacts to upload to the release. This may be a single path or a comma delimited list of paths (or globs).
|
| artifactErrorsFailBuild | An optional flag which indicates if artifact read or upload errors should fail the build. | false | "" |
|
||||||
- **artifactContentType**: The content type of the artifact. Defaults to `raw`.
|
| artifacts | An optional set of paths representing artifacts to upload to the release. This may be a single path or a comma delimited list of paths (or globs) | false | "" |
|
||||||
- **body**: An optional body for the release.
|
| artifactContentType | The content type of the artifact. Defaults to raw | false | "" |
|
||||||
- **bodyFile**: An optional body file for the release. This should be the path to the file.
|
| body | An optional body for the release. | false | "" |
|
||||||
- **commit**: An optional commit reference. This will be used to create the tag if it does not exist.
|
| bodyFile | An optional body file for the release. This should be the path to the file. | false | "" |
|
||||||
- **discussionCategory**: When provided this will generate a discussion of the specified category. The category must exist otherwise this will cause the action to fail. This isn't used with draft releases.
|
| commit | An optional commit reference. This will be used to create the tag if it does not exist. | false | "" |
|
||||||
- **draft**: Optionally marks this release as a draft release. Set to `true` to enable.
|
| discussionCategory | When provided this will generate a discussion of the specified category. The category must exist otherwise this will cause the action to fail. This isn't used with draft releases | false | "" |
|
||||||
- **generateReleaseNotes**: Indicates if release notes should be automatically generated. Set to `true` to enable.
|
| draft | Optionally marks this release as a draft release. Set to true to enable. | false | "" |
|
||||||
- **name**: An optional name for the release. If this is omitted the tag will be used.
|
| generateReleaseNotes | Indicates if release notes should be automatically generated. | false | false |
|
||||||
- **omitBody**: Indicates if the release body should be omitted.
|
| name | An optional name for the release. If this is omitted the tag will be used. | false | "" |
|
||||||
- **omitBodyDuringUpdate**: Indicates if the release body should be omitted during updates. The body will still be applied for newly created releases. This will preserve the existing body during updates.
|
| omitBody | Indicates if the release body should be omitted. | false | false |
|
||||||
- **omitName**: Indicates if the release name should be omitted.
|
| omitBodyDuringUpdate | Indicates if the release body should be omitted during updates. The body will still be applied for newly created releases. This will preserve the existing body during updates. | false | false |
|
||||||
- **omitNameDuringUpdate**: Indicates if the release name should be omitted during updates. The name will still be applied for newly created releases. This will preserve the existing name during updates.
|
| omitDraftDuringUpdate | Indicates if the draft flag should be omitted during updates. The draft flag will still be applied for newly created releases. This will preserve the existing draft state during updates. | false | false |
|
||||||
- **omitPrereleaseDuringUpdate**: Indicates if the prerelease flag should be omitted during updates. The prerelease flag will still be applied for newly created releases.
|
| omitName | Indicates if the release name should be omitted. | false | false |
|
||||||
This will preserve the existing prerelease state during updates.
|
| omitNameDuringUpdate | Indicates if the release name should be omitted during updates. The name will still be applied for newly created releases. This will preserve the existing name during updates. | false | false |
|
||||||
- **owner**: Optionally specify the owner of the repo where the release should be generated. Defaults to current repo's owner. Example - `ncipollo`.
|
| omitPrereleaseDuringUpdate | Indicates if the prerelease flag should be omitted during updates. The prerelease flag will still be applied for newly created releases. This will preserve the existing prerelease state during updates. | false | false |
|
||||||
- **prerelease**: Optionally marks this release as prerelease. Set to true to enable.
|
| owner | Optionally specify the owner of the repo where the release should be generated. Defaults to current repo'sowner. | false | "current repo owner" |
|
||||||
- **removeArtifacts**: Indicates if existing release artifacts should be removed. Defaults to `false`.
|
| prerelease | Optionally marks this release as prerelease. Set to true to enable. | false | "" |
|
||||||
- **replacesArtifacts**: Indicates if existing release artifacts should be replaced. Defaults to `true`.
|
| removeArtifacts | Indicates if existing release artifacts should be removed. | false | false |
|
||||||
- **repo**: Optionally specify the repo where the release should be generated. Defaults to current repo. Example - `release-action`.
|
| replacesArtifacts | Indicates if existing release artifacts should be replaced. | false | true |
|
||||||
- **tag**: An optional tag for the release. If this is omitted the git ref will be used (if it is a tag).
|
| repo | Optionally specify the repo where the release should be generated. | false | current repo |
|
||||||
- **token**: The GitHub token. Typically, this will be `${{ secrets.GITHUB_TOKEN }}`. If you are using a personal access token it should have access to the `repo` scope.
|
| tag | An optional tag for the release. If this is omitted the git ref will be used (if it is a tag). | false | "" |
|
||||||
|
| token | The GitHub token. This will default to the GitHub app token. This is primarily useful if you want to use your personal token (for targeting other repos, etc). If you are using a personal access token it should have access to the `repo` scope. | false | github.token |
|
||||||
|
|
||||||
## Action Outputs
|
## Action Outputs
|
||||||
- **id**: The identifier of the created release.
|
| Output name | Description |
|
||||||
- **html_url**: The HTML URL of the release.
|
|-------------|-----------------------------------------------|
|
||||||
- **upload_url**: The URL for uploading assets to the release.
|
| id | The identifier of the created release. |
|
||||||
|
| html_url | The HTML URL of the release. |
|
||||||
|
| upload_url | The URL for uploading assets to the release. |
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
This example will create a release when a tag is pushed:
|
This example will create a release when a tag is pushed:
|
||||||
@@ -49,6 +52,8 @@ jobs:
|
|||||||
|
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: ncipollo/release-action@v1
|
- uses: ncipollo/release-action@v1
|
||||||
@@ -62,3 +67,4 @@ jobs:
|
|||||||
## Notes
|
## Notes
|
||||||
- You must provide a tag either via the action input or the git ref (i.e push / create a tag). If you do not provide a tag the action will fail.
|
- You must provide a tag either via the action input or the git ref (i.e push / create a tag). If you do not provide a tag the action will fail.
|
||||||
- If the tag of the release you are creating does not yet exist, you should set both the `tag` and `commit` action inputs. `commit` can point to a commit hash or a branch name (ex - `main`).
|
- If the tag of the release you are creating does not yet exist, you should set both the `tag` and `commit` action inputs. `commit` can point to a commit hash or a branch name (ex - `main`).
|
||||||
|
- In the example above only required permissions for the action specified (which is `contents: write`). If you add other actions to the same workflow you should expand `permissions` block accordingly.
|
||||||
|
|||||||
@@ -22,20 +22,21 @@ const artifacts = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
const createBody = 'createBody'
|
const createBody = 'createBody'
|
||||||
|
const createDraft = true
|
||||||
const createName = 'createName'
|
const createName = 'createName'
|
||||||
const commit = 'commit'
|
const commit = 'commit'
|
||||||
const discussionCategory = 'discussionCategory'
|
const discussionCategory = 'discussionCategory'
|
||||||
const draft = true
|
|
||||||
const generateReleaseNotes = true
|
const generateReleaseNotes = true
|
||||||
const id = 100
|
const id = 100
|
||||||
const createPrerelease = true
|
const createPrerelease = true
|
||||||
const updatePrerelease = false
|
|
||||||
const releaseId = 101
|
const releaseId = 101
|
||||||
const replacesArtifacts = true
|
const replacesArtifacts = true
|
||||||
const tag = 'tag'
|
const tag = 'tag'
|
||||||
const token = 'token'
|
const token = 'token'
|
||||||
const updateBody = 'updateBody'
|
const updateBody = 'updateBody'
|
||||||
|
const updateDraft = false
|
||||||
const updateName = 'updateName'
|
const updateName = 'updateName'
|
||||||
|
const updatePrerelease = false
|
||||||
const url = 'http://api.example.com'
|
const url = 'http://api.example.com'
|
||||||
|
|
||||||
describe("Action", () => {
|
describe("Action", () => {
|
||||||
@@ -56,7 +57,7 @@ describe("Action", () => {
|
|||||||
createBody,
|
createBody,
|
||||||
commit,
|
commit,
|
||||||
discussionCategory,
|
discussionCategory,
|
||||||
draft,
|
createDraft,
|
||||||
generateReleaseNotes,
|
generateReleaseNotes,
|
||||||
createName,
|
createName,
|
||||||
createPrerelease)
|
createPrerelease)
|
||||||
@@ -76,7 +77,7 @@ describe("Action", () => {
|
|||||||
createBody,
|
createBody,
|
||||||
commit,
|
commit,
|
||||||
discussionCategory,
|
discussionCategory,
|
||||||
draft,
|
createDraft,
|
||||||
generateReleaseNotes,
|
generateReleaseNotes,
|
||||||
createName,
|
createName,
|
||||||
createPrerelease)
|
createPrerelease)
|
||||||
@@ -101,7 +102,7 @@ describe("Action", () => {
|
|||||||
createBody,
|
createBody,
|
||||||
commit,
|
commit,
|
||||||
discussionCategory,
|
discussionCategory,
|
||||||
draft,
|
createDraft,
|
||||||
generateReleaseNotes,
|
generateReleaseNotes,
|
||||||
createName,
|
createName,
|
||||||
createPrerelease
|
createPrerelease
|
||||||
@@ -121,7 +122,7 @@ describe("Action", () => {
|
|||||||
createBody,
|
createBody,
|
||||||
commit,
|
commit,
|
||||||
discussionCategory,
|
discussionCategory,
|
||||||
draft,
|
createDraft,
|
||||||
generateReleaseNotes,
|
generateReleaseNotes,
|
||||||
createName,
|
createName,
|
||||||
createPrerelease
|
createPrerelease
|
||||||
@@ -164,7 +165,7 @@ describe("Action", () => {
|
|||||||
createBody,
|
createBody,
|
||||||
commit,
|
commit,
|
||||||
discussionCategory,
|
discussionCategory,
|
||||||
draft,
|
createDraft,
|
||||||
generateReleaseNotes,
|
generateReleaseNotes,
|
||||||
createName,
|
createName,
|
||||||
createPrerelease
|
createPrerelease
|
||||||
@@ -215,7 +216,7 @@ describe("Action", () => {
|
|||||||
updateBody,
|
updateBody,
|
||||||
commit,
|
commit,
|
||||||
discussionCategory,
|
discussionCategory,
|
||||||
draft,
|
updateDraft,
|
||||||
updateName,
|
updateName,
|
||||||
updatePrerelease
|
updatePrerelease
|
||||||
)
|
)
|
||||||
@@ -239,7 +240,7 @@ describe("Action", () => {
|
|||||||
createBody,
|
createBody,
|
||||||
commit,
|
commit,
|
||||||
discussionCategory,
|
discussionCategory,
|
||||||
draft,
|
createDraft,
|
||||||
generateReleaseNotes,
|
generateReleaseNotes,
|
||||||
createName,
|
createName,
|
||||||
createPrerelease
|
createPrerelease
|
||||||
@@ -266,7 +267,7 @@ describe("Action", () => {
|
|||||||
updateBody,
|
updateBody,
|
||||||
commit,
|
commit,
|
||||||
discussionCategory,
|
discussionCategory,
|
||||||
draft,
|
updateDraft,
|
||||||
updateName,
|
updateName,
|
||||||
updatePrerelease
|
updatePrerelease
|
||||||
)
|
)
|
||||||
@@ -285,7 +286,7 @@ describe("Action", () => {
|
|||||||
updateBody,
|
updateBody,
|
||||||
commit,
|
commit,
|
||||||
discussionCategory,
|
discussionCategory,
|
||||||
draft,
|
updateDraft,
|
||||||
updateName,
|
updateName,
|
||||||
updatePrerelease
|
updatePrerelease
|
||||||
)
|
)
|
||||||
@@ -304,7 +305,7 @@ describe("Action", () => {
|
|||||||
updateBody,
|
updateBody,
|
||||||
commit,
|
commit,
|
||||||
discussionCategory,
|
discussionCategory,
|
||||||
draft,
|
updateDraft,
|
||||||
updateName,
|
updateName,
|
||||||
updatePrerelease
|
updatePrerelease
|
||||||
)
|
)
|
||||||
@@ -362,11 +363,11 @@ describe("Action", () => {
|
|||||||
allowUpdates: allowUpdates,
|
allowUpdates: allowUpdates,
|
||||||
artifactErrorsFailBuild: true,
|
artifactErrorsFailBuild: true,
|
||||||
artifacts: inputArtifact,
|
artifacts: inputArtifact,
|
||||||
|
createdDraft: createDraft,
|
||||||
createdReleaseBody: createBody,
|
createdReleaseBody: createBody,
|
||||||
createdReleaseName: createName,
|
createdReleaseName: createName,
|
||||||
commit: commit,
|
commit: commit,
|
||||||
discussionCategory: discussionCategory,
|
discussionCategory: discussionCategory,
|
||||||
draft: draft,
|
|
||||||
generateReleaseNotes: true,
|
generateReleaseNotes: true,
|
||||||
owner: "owner",
|
owner: "owner",
|
||||||
createdPrerelease: createPrerelease,
|
createdPrerelease: createPrerelease,
|
||||||
@@ -375,6 +376,7 @@ describe("Action", () => {
|
|||||||
repo: "repo",
|
repo: "repo",
|
||||||
tag: tag,
|
tag: tag,
|
||||||
token: token,
|
token: token,
|
||||||
|
updatedDraft: updateDraft,
|
||||||
updatedReleaseBody: updateBody,
|
updatedReleaseBody: updateBody,
|
||||||
updatedReleaseName: updateName,
|
updatedReleaseName: updateName,
|
||||||
updatedPrerelease: updatePrerelease
|
updatedPrerelease: updatePrerelease
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ describe('Inputs', () => {
|
|||||||
|
|
||||||
it('returns input.artifacts with default contentType', () => {
|
it('returns input.artifacts with default contentType', () => {
|
||||||
mockGetInput.mockReturnValueOnce('art1')
|
mockGetInput.mockReturnValueOnce('art1')
|
||||||
.mockReturnValueOnce('raw')
|
.mockReturnValueOnce('')
|
||||||
.mockReturnValueOnce('false')
|
.mockReturnValueOnce('false')
|
||||||
|
|
||||||
expect(inputs.artifacts).toEqual(artifacts)
|
expect(inputs.artifacts).toEqual(artifacts)
|
||||||
@@ -128,6 +128,17 @@ describe('Inputs', () => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
describe('createdDraft', () => {
|
||||||
|
it('returns false', () => {
|
||||||
|
expect(inputs.createdDraft).toBe(false)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('returns true', () => {
|
||||||
|
mockGetInput.mockReturnValue('true')
|
||||||
|
expect(inputs.createdDraft).toBe(true)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
describe('createdReleaseBody', () => {
|
describe('createdReleaseBody', () => {
|
||||||
it('returns input body', () => {
|
it('returns input body', () => {
|
||||||
mockGetInput
|
mockGetInput
|
||||||
@@ -174,7 +185,7 @@ describe('Inputs', () => {
|
|||||||
mockGetInput
|
mockGetInput
|
||||||
.mockReturnValueOnce('true')
|
.mockReturnValueOnce('true')
|
||||||
.mockReturnValueOnce('name')
|
.mockReturnValueOnce('name')
|
||||||
expect(inputs.createdReleaseBody).toBeUndefined()
|
expect(inputs.createdReleaseName).toBeUndefined()
|
||||||
})
|
})
|
||||||
|
|
||||||
it('returns tag', () => {
|
it('returns tag', () => {
|
||||||
@@ -198,17 +209,6 @@ describe('Inputs', () => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('draft', () => {
|
|
||||||
it('returns false', () => {
|
|
||||||
expect(inputs.draft).toBe(false)
|
|
||||||
})
|
|
||||||
|
|
||||||
it('returns true', () => {
|
|
||||||
mockGetInput.mockReturnValue('true')
|
|
||||||
expect(inputs.draft).toBe(true)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
describe('generateReleaseNotes', () => {
|
describe('generateReleaseNotes', () => {
|
||||||
it('returns returns true', function () {
|
it('returns returns true', function () {
|
||||||
mockGetInput.mockReturnValue("true")
|
mockGetInput.mockReturnValue("true")
|
||||||
@@ -294,10 +294,38 @@ describe('Inputs', () => {
|
|||||||
expect(inputs.tag).toBe('sha-tag')
|
expect(inputs.tag).toBe('sha-tag')
|
||||||
})
|
})
|
||||||
it('throws if no tag', () => {
|
it('throws if no tag', () => {
|
||||||
|
context.ref = ""
|
||||||
expect(() => inputs.tag).toThrow()
|
expect(() => inputs.tag).toThrow()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
describe('updatedDraft', () => {
|
||||||
|
it('returns false', () => {
|
||||||
|
expect(inputs.updatedDraft).toBe(false)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('returns true', () => {
|
||||||
|
mockGetInput
|
||||||
|
.mockReturnValueOnce('false')
|
||||||
|
.mockReturnValue('true')
|
||||||
|
expect(inputs.updatedDraft).toBe(true)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('returns true when omitted is blank', () => {
|
||||||
|
mockGetInput
|
||||||
|
.mockReturnValueOnce('')
|
||||||
|
.mockReturnValue('true')
|
||||||
|
expect(inputs.updatedDraft).toBe(true)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('returns undefined when omitted for update', () => {
|
||||||
|
mockGetInput
|
||||||
|
.mockReturnValueOnce('true')
|
||||||
|
.mockReturnValueOnce('true')
|
||||||
|
expect(inputs.updatedDraft).toBeUndefined()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
describe('updatedReleaseBody', () => {
|
describe('updatedReleaseBody', () => {
|
||||||
it('returns input body', () => {
|
it('returns input body', () => {
|
||||||
mockGetInput
|
mockGetInput
|
||||||
|
|||||||
@@ -41,11 +41,11 @@ describe.skip('Integration Test', () => {
|
|||||||
allowUpdates: true,
|
allowUpdates: true,
|
||||||
artifactErrorsFailBuild: false,
|
artifactErrorsFailBuild: false,
|
||||||
artifacts: artifacts(),
|
artifacts: artifacts(),
|
||||||
|
createdDraft: false,
|
||||||
createdReleaseBody: "This release was generated by release-action's integration test",
|
createdReleaseBody: "This release was generated by release-action's integration test",
|
||||||
createdReleaseName: "Releases Action Integration Test",
|
createdReleaseName: "Releases Action Integration Test",
|
||||||
commit: undefined,
|
commit: undefined,
|
||||||
discussionCategory: 'Release',
|
discussionCategory: 'Release',
|
||||||
draft: false,
|
|
||||||
generateReleaseNotes: true,
|
generateReleaseNotes: true,
|
||||||
owner: "ncipollo",
|
owner: "ncipollo",
|
||||||
createdPrerelease: false,
|
createdPrerelease: false,
|
||||||
@@ -54,6 +54,7 @@ describe.skip('Integration Test', () => {
|
|||||||
repo: "actions-playground",
|
repo: "actions-playground",
|
||||||
tag: "release-action-test",
|
tag: "release-action-test",
|
||||||
token: getToken(),
|
token: getToken(),
|
||||||
|
updatedDraft: false,
|
||||||
updatedReleaseBody: "This release was generated by release-action's integration test",
|
updatedReleaseBody: "This release was generated by release-action's integration test",
|
||||||
updatedReleaseName: "Releases Action Integration Test",
|
updatedReleaseName: "Releases Action Integration Test",
|
||||||
updatedPrerelease: false
|
updatedPrerelease: false
|
||||||
|
|||||||
@@ -59,6 +59,10 @@ inputs:
|
|||||||
description: 'Indicates if the release body should be omitted during updates. The body will still be applied for newly created releases. This will preserve the existing body during updates.'
|
description: 'Indicates if the release body should be omitted during updates. The body will still be applied for newly created releases. This will preserve the existing body during updates.'
|
||||||
required: false
|
required: false
|
||||||
default: 'false'
|
default: 'false'
|
||||||
|
omitDraftDuringUpdate:
|
||||||
|
description: 'Indicates if the draft flag should be omitted during updates. The draft flag will still be applied for newly created releases. This will preserve the existing draft state during updates.'
|
||||||
|
required: false
|
||||||
|
default: 'false'
|
||||||
omitName:
|
omitName:
|
||||||
description: 'Indicates if the release name should be omitted.'
|
description: 'Indicates if the release name should be omitted.'
|
||||||
required: false
|
required: false
|
||||||
|
|||||||
2354
dist/index.js
vendored
2354
dist/index.js
vendored
File diff suppressed because one or more lines are too long
2
dist/index.js.map
vendored
2
dist/index.js.map
vendored
File diff suppressed because one or more lines are too long
44
dist/licenses.txt
vendored
44
dist/licenses.txt
vendored
@@ -750,6 +750,9 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|||||||
THE SOFTWARE.
|
THE SOFTWARE.
|
||||||
|
|
||||||
|
|
||||||
|
tr46
|
||||||
|
MIT
|
||||||
|
|
||||||
tunnel
|
tunnel
|
||||||
MIT
|
MIT
|
||||||
The MIT License (MIT)
|
The MIT License (MIT)
|
||||||
@@ -799,6 +802,47 @@ The above copyright notice and this permission notice shall be included in all c
|
|||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
|
|
||||||
|
webidl-conversions
|
||||||
|
BSD-2-Clause
|
||||||
|
# The BSD 2-Clause License
|
||||||
|
|
||||||
|
Copyright (c) 2014, Domenic Denicola
|
||||||
|
All rights reserved.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||||
|
|
||||||
|
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||||
|
|
||||||
|
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
|
|
||||||
|
whatwg-url
|
||||||
|
MIT
|
||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright (c) 2015–2016 Sebastian Mayr
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
||||||
|
|
||||||
|
|
||||||
wrappy
|
wrappy
|
||||||
ISC
|
ISC
|
||||||
The ISC License
|
The ISC License
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ class Action {
|
|||||||
}
|
}
|
||||||
updateRelease(id) {
|
updateRelease(id) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
return yield this.releases.update(id, this.inputs.tag, this.inputs.updatedReleaseBody, this.inputs.commit, this.inputs.discussionCategory, this.inputs.draft, this.inputs.updatedReleaseName, this.inputs.updatedPrerelease);
|
return yield this.releases.update(id, this.inputs.tag, this.inputs.updatedReleaseBody, this.inputs.commit, this.inputs.discussionCategory, this.inputs.updatedDraft, this.inputs.updatedReleaseName, this.inputs.updatedPrerelease);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
static noPublishedRelease(error) {
|
static noPublishedRelease(error) {
|
||||||
@@ -93,7 +93,7 @@ class Action {
|
|||||||
}
|
}
|
||||||
createRelease() {
|
createRelease() {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
return yield this.releases.create(this.inputs.tag, this.inputs.createdReleaseBody, this.inputs.commit, this.inputs.discussionCategory, this.inputs.draft, this.inputs.generateReleaseNotes, this.inputs.createdReleaseName, this.inputs.createdPrerelease);
|
return yield this.releases.create(this.inputs.tag, this.inputs.createdReleaseBody, this.inputs.commit, this.inputs.discussionCategory, this.inputs.createdDraft, this.inputs.generateReleaseNotes, this.inputs.createdReleaseName, this.inputs.createdPrerelease);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,11 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||||
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||||
|
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||||
|
}
|
||||||
|
Object.defineProperty(o, k2, desc);
|
||||||
}) : (function(o, m, k, k2) {
|
}) : (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
o[k2] = m[k];
|
o[k2] = m[k];
|
||||||
|
|||||||
@@ -1,7 +1,11 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||||
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||||
|
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||||
|
}
|
||||||
|
Object.defineProperty(o, k2, desc);
|
||||||
}) : (function(o, m, k, k2) {
|
}) : (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
o[k2] = m[k];
|
o[k2] = m[k];
|
||||||
|
|||||||
@@ -1,7 +1,11 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||||
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||||
|
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||||
|
}
|
||||||
|
Object.defineProperty(o, k2, desc);
|
||||||
}) : (function(o, m, k, k2) {
|
}) : (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
o[k2] = m[k];
|
o[k2] = m[k];
|
||||||
|
|||||||
@@ -1,7 +1,11 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||||
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||||
|
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||||
|
}
|
||||||
|
Object.defineProperty(o, k2, desc);
|
||||||
}) : (function(o, m, k, k2) {
|
}) : (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
o[k2] = m[k];
|
o[k2] = m[k];
|
||||||
|
|||||||
@@ -1,7 +1,11 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||||
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||||
|
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||||
|
}
|
||||||
|
Object.defineProperty(o, k2, desc);
|
||||||
}) : (function(o, m, k, k2) {
|
}) : (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
o[k2] = m[k];
|
o[k2] = m[k];
|
||||||
@@ -50,14 +54,6 @@ class CoreInputs {
|
|||||||
const allow = core.getInput('artifactErrorsFailBuild');
|
const allow = core.getInput('artifactErrorsFailBuild');
|
||||||
return allow == 'true';
|
return allow == 'true';
|
||||||
}
|
}
|
||||||
get createdReleaseBody() {
|
|
||||||
if (CoreInputs.omitBody)
|
|
||||||
return undefined;
|
|
||||||
return this.body;
|
|
||||||
}
|
|
||||||
static get omitBody() {
|
|
||||||
return core.getInput('omitBody') == 'true';
|
|
||||||
}
|
|
||||||
get body() {
|
get body() {
|
||||||
const body = core.getInput('body');
|
const body = core.getInput('body');
|
||||||
if (body) {
|
if (body) {
|
||||||
@@ -69,6 +65,30 @@ class CoreInputs {
|
|||||||
}
|
}
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
get createdDraft() {
|
||||||
|
const draft = core.getInput('draft');
|
||||||
|
return draft == 'true';
|
||||||
|
}
|
||||||
|
get createdPrerelease() {
|
||||||
|
const preRelease = core.getInput('prerelease');
|
||||||
|
return preRelease == 'true';
|
||||||
|
}
|
||||||
|
get createdReleaseBody() {
|
||||||
|
if (CoreInputs.omitBody)
|
||||||
|
return undefined;
|
||||||
|
return this.body;
|
||||||
|
}
|
||||||
|
static get omitBody() {
|
||||||
|
return core.getInput('omitBody') == 'true';
|
||||||
|
}
|
||||||
|
get createdReleaseName() {
|
||||||
|
if (CoreInputs.omitName)
|
||||||
|
return undefined;
|
||||||
|
return this.name;
|
||||||
|
}
|
||||||
|
static get omitName() {
|
||||||
|
return core.getInput('omitName') == 'true';
|
||||||
|
}
|
||||||
get commit() {
|
get commit() {
|
||||||
const commit = core.getInput('commit');
|
const commit = core.getInput('commit');
|
||||||
if (commit) {
|
if (commit) {
|
||||||
@@ -76,11 +96,6 @@ class CoreInputs {
|
|||||||
}
|
}
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
get createdReleaseName() {
|
|
||||||
if (CoreInputs.omitName)
|
|
||||||
return undefined;
|
|
||||||
return this.name;
|
|
||||||
}
|
|
||||||
get discussionCategory() {
|
get discussionCategory() {
|
||||||
const category = core.getInput('discussionCategory');
|
const category = core.getInput('discussionCategory');
|
||||||
if (category) {
|
if (category) {
|
||||||
@@ -88,9 +103,6 @@ class CoreInputs {
|
|||||||
}
|
}
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
static get omitName() {
|
|
||||||
return core.getInput('omitName') == 'true';
|
|
||||||
}
|
|
||||||
get name() {
|
get name() {
|
||||||
const name = core.getInput('name');
|
const name = core.getInput('name');
|
||||||
if (name) {
|
if (name) {
|
||||||
@@ -98,10 +110,6 @@ class CoreInputs {
|
|||||||
}
|
}
|
||||||
return this.tag;
|
return this.tag;
|
||||||
}
|
}
|
||||||
get draft() {
|
|
||||||
const draft = core.getInput('draft');
|
|
||||||
return draft == 'true';
|
|
||||||
}
|
|
||||||
get generateReleaseNotes() {
|
get generateReleaseNotes() {
|
||||||
const generate = core.getInput('generateReleaseNotes');
|
const generate = core.getInput('generateReleaseNotes');
|
||||||
return generate == 'true';
|
return generate == 'true';
|
||||||
@@ -113,18 +121,6 @@ class CoreInputs {
|
|||||||
}
|
}
|
||||||
return this.context.repo.owner;
|
return this.context.repo.owner;
|
||||||
}
|
}
|
||||||
get createdPrerelease() {
|
|
||||||
const preRelease = core.getInput('prerelease');
|
|
||||||
return preRelease == 'true';
|
|
||||||
}
|
|
||||||
static get omitPrereleaseDuringUpdate() {
|
|
||||||
return core.getInput('omitPrereleaseDuringUpdate') == 'true';
|
|
||||||
}
|
|
||||||
get updatedPrerelease() {
|
|
||||||
if (CoreInputs.omitPrereleaseDuringUpdate)
|
|
||||||
return undefined;
|
|
||||||
return this.createdPrerelease;
|
|
||||||
}
|
|
||||||
get removeArtifacts() {
|
get removeArtifacts() {
|
||||||
const removes = core.getInput('removeArtifacts');
|
const removes = core.getInput('removeArtifacts');
|
||||||
return removes == 'true';
|
return removes == 'true';
|
||||||
@@ -155,6 +151,22 @@ class CoreInputs {
|
|||||||
get token() {
|
get token() {
|
||||||
return core.getInput('token', { required: true });
|
return core.getInput('token', { required: true });
|
||||||
}
|
}
|
||||||
|
get updatedDraft() {
|
||||||
|
if (CoreInputs.omitDraftDuringUpdate)
|
||||||
|
return undefined;
|
||||||
|
return this.createdDraft;
|
||||||
|
}
|
||||||
|
static get omitDraftDuringUpdate() {
|
||||||
|
return core.getInput('omitDraftDuringUpdate') == 'true';
|
||||||
|
}
|
||||||
|
get updatedPrerelease() {
|
||||||
|
if (CoreInputs.omitPrereleaseDuringUpdate)
|
||||||
|
return undefined;
|
||||||
|
return this.createdPrerelease;
|
||||||
|
}
|
||||||
|
static get omitPrereleaseDuringUpdate() {
|
||||||
|
return core.getInput('omitPrereleaseDuringUpdate') == 'true';
|
||||||
|
}
|
||||||
get updatedReleaseBody() {
|
get updatedReleaseBody() {
|
||||||
if (CoreInputs.omitBody || CoreInputs.omitBodyDuringUpdate)
|
if (CoreInputs.omitBody || CoreInputs.omitBodyDuringUpdate)
|
||||||
return undefined;
|
return undefined;
|
||||||
|
|||||||
@@ -1,7 +1,11 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||||
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||||
|
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||||
|
}
|
||||||
|
Object.defineProperty(o, k2, desc);
|
||||||
}) : (function(o, m, k, k2) {
|
}) : (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
o[k2] = m[k];
|
o[k2] = m[k];
|
||||||
|
|||||||
@@ -1,7 +1,11 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||||
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||||
|
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||||
|
}
|
||||||
|
Object.defineProperty(o, k2, desc);
|
||||||
}) : (function(o, m, k, k2) {
|
}) : (function(o, m, k, k2) {
|
||||||
if (k2 === undefined) k2 = k;
|
if (k2 === undefined) k2 = k;
|
||||||
o[k2] = m[k];
|
o[k2] = m[k];
|
||||||
|
|||||||
13
package.json
13
package.json
@@ -7,6 +7,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "tsc",
|
"build": "tsc",
|
||||||
"clean": "rm -rf lib/*",
|
"clean": "rm -rf lib/*",
|
||||||
|
"coverage": "jest --coverage",
|
||||||
"debug": "yarn clean && yarn install && yarn build && yarn package",
|
"debug": "yarn clean && yarn install && yarn build && yarn package",
|
||||||
"package": "ncc build --source-map --license licenses.txt",
|
"package": "ncc build --source-map --license licenses.txt",
|
||||||
"release": "yarn clean && yarn install --production && yarn build && yarn package",
|
"release": "yarn clean && yarn install --production && yarn build && yarn package",
|
||||||
@@ -31,11 +32,11 @@
|
|||||||
"untildify": "^4.0.0"
|
"untildify": "^4.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/jest": "^27.0.2",
|
"@types/jest": "^27.4.0",
|
||||||
"@types/node": "^16.11.6",
|
"@types/node": "^17.0.21",
|
||||||
"jest": "^27.3.1",
|
"jest": "^27.5.1",
|
||||||
"jest-circus": "^27.3.1",
|
"jest-circus": "^27.5.1",
|
||||||
"ts-jest": "^27.0.7",
|
"ts-jest": "^27.1.3",
|
||||||
"typescript": "^4.4.4"
|
"typescript": "^4.6.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ export class Action {
|
|||||||
this.inputs.updatedReleaseBody,
|
this.inputs.updatedReleaseBody,
|
||||||
this.inputs.commit,
|
this.inputs.commit,
|
||||||
this.inputs.discussionCategory,
|
this.inputs.discussionCategory,
|
||||||
this.inputs.draft,
|
this.inputs.updatedDraft,
|
||||||
this.inputs.updatedReleaseName,
|
this.inputs.updatedReleaseName,
|
||||||
this.inputs.updatedPrerelease
|
this.inputs.updatedPrerelease
|
||||||
)
|
)
|
||||||
@@ -113,7 +113,7 @@ export class Action {
|
|||||||
this.inputs.createdReleaseBody,
|
this.inputs.createdReleaseBody,
|
||||||
this.inputs.commit,
|
this.inputs.commit,
|
||||||
this.inputs.discussionCategory,
|
this.inputs.discussionCategory,
|
||||||
this.inputs.draft,
|
this.inputs.createdDraft,
|
||||||
this.inputs.generateReleaseNotes,
|
this.inputs.generateReleaseNotes,
|
||||||
this.inputs.createdReleaseName,
|
this.inputs.createdReleaseName,
|
||||||
this.inputs.createdPrerelease
|
this.inputs.createdPrerelease
|
||||||
|
|||||||
@@ -9,18 +9,19 @@ export interface Inputs {
|
|||||||
readonly artifactErrorsFailBuild: boolean
|
readonly artifactErrorsFailBuild: boolean
|
||||||
readonly artifacts: Artifact[]
|
readonly artifacts: Artifact[]
|
||||||
readonly commit?: string
|
readonly commit?: string
|
||||||
|
readonly createdDraft: boolean
|
||||||
|
readonly createdPrerelease: boolean
|
||||||
readonly createdReleaseBody?: string
|
readonly createdReleaseBody?: string
|
||||||
readonly createdReleaseName?: string
|
readonly createdReleaseName?: string
|
||||||
readonly discussionCategory?: string
|
readonly discussionCategory?: string
|
||||||
readonly draft: boolean
|
|
||||||
readonly generateReleaseNotes: boolean
|
readonly generateReleaseNotes: boolean
|
||||||
readonly owner: string
|
readonly owner: string
|
||||||
readonly createdPrerelease: boolean
|
|
||||||
readonly removeArtifacts: boolean
|
readonly removeArtifacts: boolean
|
||||||
readonly replacesArtifacts: boolean
|
readonly replacesArtifacts: boolean
|
||||||
readonly repo: string
|
readonly repo: string
|
||||||
readonly tag: string
|
readonly tag: string
|
||||||
readonly token: string
|
readonly token: string
|
||||||
|
readonly updatedDraft?: boolean
|
||||||
readonly updatedReleaseBody?: string
|
readonly updatedReleaseBody?: string
|
||||||
readonly updatedReleaseName?: string
|
readonly updatedReleaseName?: string
|
||||||
readonly updatedPrerelease?: boolean
|
readonly updatedPrerelease?: boolean
|
||||||
@@ -61,15 +62,6 @@ export class CoreInputs implements Inputs {
|
|||||||
return allow == 'true'
|
return allow == 'true'
|
||||||
}
|
}
|
||||||
|
|
||||||
get createdReleaseBody(): string | undefined {
|
|
||||||
if (CoreInputs.omitBody) return undefined
|
|
||||||
return this.body
|
|
||||||
}
|
|
||||||
|
|
||||||
private static get omitBody(): boolean {
|
|
||||||
return core.getInput('omitBody') == 'true'
|
|
||||||
}
|
|
||||||
|
|
||||||
private get body(): string | undefined {
|
private get body(): string | undefined {
|
||||||
const body = core.getInput('body')
|
const body = core.getInput('body')
|
||||||
if (body) {
|
if (body) {
|
||||||
@@ -84,6 +76,34 @@ export class CoreInputs implements Inputs {
|
|||||||
return ''
|
return ''
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get createdDraft(): boolean {
|
||||||
|
const draft = core.getInput('draft')
|
||||||
|
return draft == 'true'
|
||||||
|
}
|
||||||
|
|
||||||
|
get createdPrerelease(): boolean {
|
||||||
|
const preRelease = core.getInput('prerelease')
|
||||||
|
return preRelease == 'true'
|
||||||
|
}
|
||||||
|
|
||||||
|
get createdReleaseBody(): string | undefined {
|
||||||
|
if (CoreInputs.omitBody) return undefined
|
||||||
|
return this.body
|
||||||
|
}
|
||||||
|
|
||||||
|
private static get omitBody(): boolean {
|
||||||
|
return core.getInput('omitBody') == 'true'
|
||||||
|
}
|
||||||
|
|
||||||
|
get createdReleaseName(): string | undefined {
|
||||||
|
if (CoreInputs.omitName) return undefined
|
||||||
|
return this.name
|
||||||
|
}
|
||||||
|
|
||||||
|
private static get omitName(): boolean {
|
||||||
|
return core.getInput('omitName') == 'true'
|
||||||
|
}
|
||||||
|
|
||||||
get commit(): string | undefined {
|
get commit(): string | undefined {
|
||||||
const commit = core.getInput('commit')
|
const commit = core.getInput('commit')
|
||||||
if (commit) {
|
if (commit) {
|
||||||
@@ -92,11 +112,6 @@ export class CoreInputs implements Inputs {
|
|||||||
return undefined
|
return undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
get createdReleaseName(): string | undefined {
|
|
||||||
if (CoreInputs.omitName) return undefined
|
|
||||||
return this.name
|
|
||||||
}
|
|
||||||
|
|
||||||
get discussionCategory(): string | undefined {
|
get discussionCategory(): string | undefined {
|
||||||
const category = core.getInput('discussionCategory')
|
const category = core.getInput('discussionCategory')
|
||||||
if (category) {
|
if (category) {
|
||||||
@@ -105,10 +120,6 @@ export class CoreInputs implements Inputs {
|
|||||||
return undefined
|
return undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
private static get omitName(): boolean {
|
|
||||||
return core.getInput('omitName') == 'true'
|
|
||||||
}
|
|
||||||
|
|
||||||
private get name(): string | undefined {
|
private get name(): string | undefined {
|
||||||
const name = core.getInput('name')
|
const name = core.getInput('name')
|
||||||
if (name) {
|
if (name) {
|
||||||
@@ -117,11 +128,6 @@ export class CoreInputs implements Inputs {
|
|||||||
|
|
||||||
return this.tag
|
return this.tag
|
||||||
}
|
}
|
||||||
|
|
||||||
get draft(): boolean {
|
|
||||||
const draft = core.getInput('draft')
|
|
||||||
return draft == 'true'
|
|
||||||
}
|
|
||||||
|
|
||||||
get generateReleaseNotes(): boolean {
|
get generateReleaseNotes(): boolean {
|
||||||
const generate = core.getInput('generateReleaseNotes')
|
const generate = core.getInput('generateReleaseNotes')
|
||||||
@@ -135,20 +141,7 @@ export class CoreInputs implements Inputs {
|
|||||||
}
|
}
|
||||||
return this.context.repo.owner
|
return this.context.repo.owner
|
||||||
}
|
}
|
||||||
|
|
||||||
get createdPrerelease(): boolean {
|
|
||||||
const preRelease = core.getInput('prerelease')
|
|
||||||
return preRelease == 'true'
|
|
||||||
}
|
|
||||||
|
|
||||||
private static get omitPrereleaseDuringUpdate(): boolean {
|
|
||||||
return core.getInput('omitPrereleaseDuringUpdate') == 'true'
|
|
||||||
}
|
|
||||||
|
|
||||||
get updatedPrerelease(): boolean | undefined {
|
|
||||||
if (CoreInputs.omitPrereleaseDuringUpdate) return undefined
|
|
||||||
return this.createdPrerelease
|
|
||||||
}
|
|
||||||
get removeArtifacts(): boolean {
|
get removeArtifacts(): boolean {
|
||||||
const removes = core.getInput('removeArtifacts')
|
const removes = core.getInput('removeArtifacts')
|
||||||
return removes == 'true'
|
return removes == 'true'
|
||||||
@@ -185,6 +178,24 @@ export class CoreInputs implements Inputs {
|
|||||||
return core.getInput('token', {required: true})
|
return core.getInput('token', {required: true})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get updatedDraft(): boolean | undefined {
|
||||||
|
if (CoreInputs.omitDraftDuringUpdate) return undefined
|
||||||
|
return this.createdDraft
|
||||||
|
}
|
||||||
|
|
||||||
|
private static get omitDraftDuringUpdate(): boolean {
|
||||||
|
return core.getInput('omitDraftDuringUpdate') == 'true'
|
||||||
|
}
|
||||||
|
|
||||||
|
get updatedPrerelease(): boolean | undefined {
|
||||||
|
if (CoreInputs.omitPrereleaseDuringUpdate) return undefined
|
||||||
|
return this.createdPrerelease
|
||||||
|
}
|
||||||
|
|
||||||
|
private static get omitPrereleaseDuringUpdate(): boolean {
|
||||||
|
return core.getInput('omitPrereleaseDuringUpdate') == 'true'
|
||||||
|
}
|
||||||
|
|
||||||
get updatedReleaseBody(): string | undefined {
|
get updatedReleaseBody(): string | undefined {
|
||||||
if (CoreInputs.omitBody || CoreInputs.omitBodyDuringUpdate) return undefined
|
if (CoreInputs.omitBody || CoreInputs.omitBodyDuringUpdate) return undefined
|
||||||
return this.body
|
return this.body
|
||||||
|
|||||||
Reference in New Issue
Block a user