17 Commits
2.0.0 ... 2.1.1

Author SHA1 Message Date
Sven-Hendrik Haase
4ce0a13e83 This is 2.1.1 2020-09-25 05:40:59 +02:00
Sven-Hendrik Haase
6ca3eb1422 Add CHANGELOG entry for 2.1.1 2020-09-25 05:40:29 +02:00
Sven-Hendrik Haase
54a6699008 Merge pull request #27 from kittaakos/GH-26
GH-26: Fixed ignored `release_name` option.
2020-09-25 05:18:30 +02:00
Sven-Hendrik Haase
afb12c9a16 Merge pull request #29 from svenstaro/dependabot/npm_and_yarn/node-fetch-2.6.1
Bump node-fetch from 2.6.0 to 2.6.1
2020-09-12 15:18:12 +02:00
dependabot[bot]
89767936cf Bump node-fetch from 2.6.0 to 2.6.1
Bumps [node-fetch](https://github.com/bitinn/node-fetch) from 2.6.0 to 2.6.1.
- [Release notes](https://github.com/bitinn/node-fetch/releases)
- [Changelog](https://github.com/node-fetch/node-fetch/blob/master/docs/CHANGELOG.md)
- [Commits](https://github.com/bitinn/node-fetch/compare/v2.6.0...v2.6.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-09-12 07:26:42 +00:00
Akos Kitta
d3d2e8da76 GH-26: Fixed ignored release_name option.
`name` should be used when creating a new release.

Signed-off-by: Akos Kitta <kittaakos@typefox.io>
2020-09-02 16:57:09 +02:00
Sven-Hendrik Haase
ec0ba8651f 2.1.0 2020-08-10 05:21:17 +02:00
Sven-Hendrik Haase
0d3c327d15 Merge pull request #23 from OmarEmaraDev/strip-refs-heads
Strip refs/heads/ from the input tag.
2020-08-10 05:02:21 +02:00
Omar Emara
24dc1f0ef1 Update the description of the tag input. 2020-08-07 17:02:07 +02:00
Omar Emara
94502fe175 Strip refs/heads/ from the input tag.
This patch strips refs/heads/ from the input tag to make it easier to
use the action with pushes on branches.
2020-08-05 18:54:20 +02:00
Sven-Hendrik Haase
2f92806c5d Merge pull request #21 from svenstaro/dependabot/npm_and_yarn/lodash-4.17.19
Bump lodash from 4.17.15 to 4.17.19
2020-07-23 20:58:26 +02:00
dependabot[bot]
d715678c11 Bump lodash from 4.17.15 to 4.17.19
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.19.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.15...4.17.19)

Signed-off-by: dependabot[bot] <support@github.com>
2020-07-18 01:49:53 +00:00
Sven-Hendrik Haase
3735b5ec52 Fix typos 2020-07-03 10:29:57 +02:00
Sven-Hendrik Haase
17fcb1df4f Fix last commit 2 2020-07-03 10:29:30 +02:00
Sven-Hendrik Haase
47b74e816a Fix last commit 2020-07-03 10:27:31 +02:00
Sven-Hendrik Haase
a9a904a8a4 Make sure parallel CI runs can't interfere 2020-07-03 10:24:43 +02:00
Sven-Hendrik Haase
49404e33ce Run versioning flow on ubuntu-latest 2020-07-03 10:22:24 +02:00
8 changed files with 30 additions and 18 deletions

View File

@@ -28,7 +28,7 @@ jobs:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: README.md
asset_name: TEST.md
tag: ci-test-${{ matrix.os }}
tag: ci-test-${{ matrix.os }}-${{ github.run_id }}
overwrite: true
prerelease: true
body: "rofl lol test"
@@ -44,7 +44,7 @@ jobs:
const expected = fs.readFileSync("README.md")
const release = await github.repos.getReleaseByTag({
...context.repo,
tag: "ci-test-${{ matrix.os }}",
tag: "ci-test-${{ matrix.os }}-${{ github.run_id }}",
})
assert.deepStrictEqual(release.data.prerelease, true)
assert.deepStrictEqual(release.data.body, "rofl lol test")
@@ -59,7 +59,7 @@ jobs:
script: |
const release = await github.repos.getReleaseByTag({
...context.repo,
tag: "ci-test-${{ matrix.os }}",
tag: "ci-test-${{ matrix.os }}-${{ github.run_id }}",
})
await github.repos.deleteRelease({
...context.repo,
@@ -67,5 +67,5 @@ jobs:
})
await github.git.deleteRef({
...context.repo,
ref: "tags/ci-test-${{ matrix.os }}",
ref: "tags/ci-test-${{ matrix.os }}-${{ github.run_id }}",
})

View File

@@ -6,7 +6,7 @@ on:
jobs:
actions-tagger:
runs-on: windows-latest
runs-on: ubuntu-latest
steps:
- uses: Actions-R-Us/actions-tagger@latest
env:

View File

@@ -1,5 +1,11 @@
# Changelog
## [2.1.1] - 2020-09-25
- Fix `release_name` option [#27](https://github.com/svenstaro/upload-release-action/pull/27) (thanks @kittaakos)
## [2.1.0] - 2020-08-10
- Strip refs/heads/ from the input tag [#23](https://github.com/svenstaro/upload-release-action/pull/23) (thanks @OmarEmaraDev)
## [2.0.0] - 2020-07-03
- Add `prerelease` input parameter. Setting this marks the created release as a pre-release.
- Add `release_name` input parameter. Setting this explicitly sets the title of the release.

View File

@@ -9,7 +9,7 @@ You must provide:
- `repo_token`: Usually you'll want to set this to `${{ secrets.GITHUB_TOKEN }}`.
- `file`: A local file to be uploaded as the asset.
- `tag`: The tag to upload into. If you want the current event's tag, use `${{ github.ref }}` (the `refs/tags/` prefix will be automatically stripped).
- `tag`: The tag to upload into. If you want the current event's tag or branch name, use `${{ github.ref }}` (the `refs/tags/` and `refs/heads/` prefixes will be automatically stripped).
Optional Arguments

7
dist/index.js vendored
View File

@@ -2211,7 +2211,7 @@ function get_release_by_tag(tag, prerelease, release_name, body, octokit) {
// If this returns 404, we need to create the release first.
if (error.status === 404) {
core.debug(`Release for tag ${tag} doesn't exist yet so we'll create it now.`);
return yield octokit.repos.createRelease(Object.assign(Object.assign({}, github.context.repo), { tag_name: tag, prerelease: prerelease, release_name: release_name, body: body }));
return yield octokit.repos.createRelease(Object.assign(Object.assign({}, github.context.repo), { tag_name: tag, prerelease: prerelease, name: release_name, body: body }));
}
else {
throw error;
@@ -2263,7 +2263,10 @@ function run() {
// Get the inputs from the workflow file: https://github.com/actions/toolkit/tree/master/packages/core#inputsoutputs
const token = core.getInput('repo_token', { required: true });
const file = core.getInput('file', { required: true });
const tag = core.getInput('tag', { required: true }).replace('refs/tags/', '');
const tag = core
.getInput('tag', { required: true })
.replace('refs/tags/', '')
.replace('refs/heads/', '');
const file_glob = core.getInput('file_glob') == 'true' ? true : false;
const overwrite = core.getInput('overwrite') == 'true' ? true : false;
const prerelease = core.getInput('prerelease') == 'true' ? true : false;

14
package-lock.json generated
View File

@@ -1,6 +1,6 @@
{
"name": "upload-release-action",
"version": "1.0.2",
"version": "2.1.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@@ -6664,9 +6664,9 @@
}
},
"lodash": {
"version": "4.17.15",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz",
"integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==",
"version": "4.17.19",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz",
"integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==",
"dev": true
},
"lodash.memoize": {
@@ -6860,9 +6860,9 @@
"integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ=="
},
"node-fetch": {
"version": "2.6.0",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz",
"integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA=="
"version": "2.6.1",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz",
"integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw=="
},
"node-int64": {
"version": "0.4.0",

View File

@@ -1,6 +1,6 @@
{
"name": "upload-release-action",
"version": "2.0.0",
"version": "2.1.1",
"private": true,
"description": "Upload files to a GitHub release",
"main": "lib/main.js",

View File

@@ -34,7 +34,7 @@ async function get_release_by_tag(
...github.context.repo,
tag_name: tag,
prerelease: prerelease,
release_name: release_name,
name: release_name,
body: body
})
} else {
@@ -104,7 +104,10 @@ async function run(): Promise<void> {
// Get the inputs from the workflow file: https://github.com/actions/toolkit/tree/master/packages/core#inputsoutputs
const token = core.getInput('repo_token', {required: true})
const file = core.getInput('file', {required: true})
const tag = core.getInput('tag', {required: true}).replace('refs/tags/', '')
const tag = core
.getInput('tag', {required: true})
.replace('refs/tags/', '')
.replace('refs/heads/', '')
const file_glob = core.getInput('file_glob') == 'true' ? true : false
const overwrite = core.getInput('overwrite') == 'true' ? true : false