Compare commits
17 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4ce0a13e83 | ||
|
|
6ca3eb1422 | ||
|
|
54a6699008 | ||
|
|
afb12c9a16 | ||
|
|
89767936cf | ||
|
|
d3d2e8da76 | ||
|
|
ec0ba8651f | ||
|
|
0d3c327d15 | ||
|
|
24dc1f0ef1 | ||
|
|
94502fe175 | ||
|
|
2f92806c5d | ||
|
|
d715678c11 | ||
|
|
3735b5ec52 | ||
|
|
17fcb1df4f | ||
|
|
47b74e816a | ||
|
|
a9a904a8a4 | ||
|
|
49404e33ce |
8
.github/workflows/ci.yml
vendored
8
.github/workflows/ci.yml
vendored
@@ -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 }}",
|
||||
})
|
||||
|
||||
2
.github/workflows/versioning.yml
vendored
2
.github/workflows/versioning.yml
vendored
@@ -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:
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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
7
dist/index.js
vendored
@@ -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
14
package-lock.json
generated
@@ -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",
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user