Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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 }}
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
file: README.md
|
file: README.md
|
||||||
asset_name: TEST.md
|
asset_name: TEST.md
|
||||||
tag: ci-test-${{ matrix.os }}
|
tag: ci-test-${{ matrix.os }}-${{ github.run_id }}
|
||||||
overwrite: true
|
overwrite: true
|
||||||
prerelease: true
|
prerelease: true
|
||||||
body: "rofl lol test"
|
body: "rofl lol test"
|
||||||
@@ -44,7 +44,7 @@ jobs:
|
|||||||
const expected = fs.readFileSync("README.md")
|
const expected = fs.readFileSync("README.md")
|
||||||
const release = await github.repos.getReleaseByTag({
|
const release = await github.repos.getReleaseByTag({
|
||||||
...context.repo,
|
...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.prerelease, true)
|
||||||
assert.deepStrictEqual(release.data.body, "rofl lol test")
|
assert.deepStrictEqual(release.data.body, "rofl lol test")
|
||||||
@@ -59,7 +59,7 @@ jobs:
|
|||||||
script: |
|
script: |
|
||||||
const release = await github.repos.getReleaseByTag({
|
const release = await github.repos.getReleaseByTag({
|
||||||
...context.repo,
|
...context.repo,
|
||||||
tag: "ci-test-${{ matrix.os }}",
|
tag: "ci-test-${{ matrix.os }}-${{ github.run_id }}",
|
||||||
})
|
})
|
||||||
await github.repos.deleteRelease({
|
await github.repos.deleteRelease({
|
||||||
...context.repo,
|
...context.repo,
|
||||||
@@ -67,5 +67,5 @@ jobs:
|
|||||||
})
|
})
|
||||||
await github.git.deleteRef({
|
await github.git.deleteRef({
|
||||||
...context.repo,
|
...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:
|
jobs:
|
||||||
actions-tagger:
|
actions-tagger:
|
||||||
runs-on: windows-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: Actions-R-Us/actions-tagger@latest
|
- uses: Actions-R-Us/actions-tagger@latest
|
||||||
env:
|
env:
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## [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
|
## [2.0.0] - 2020-07-03
|
||||||
- Add `prerelease` input parameter. Setting this marks the created release as a pre-release.
|
- 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.
|
- 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 }}`.
|
- `repo_token`: Usually you'll want to set this to `${{ secrets.GITHUB_TOKEN }}`.
|
||||||
- `file`: A local file to be uploaded as the asset.
|
- `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
|
Optional Arguments
|
||||||
|
|
||||||
|
|||||||
2
dist/index.js
vendored
2
dist/index.js
vendored
@@ -2263,7 +2263,7 @@ function run() {
|
|||||||
// Get the inputs from the workflow file: https://github.com/actions/toolkit/tree/master/packages/core#inputsoutputs
|
// 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 token = core.getInput('repo_token', { required: true });
|
||||||
const file = core.getInput('file', { 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 file_glob = core.getInput('file_glob') == 'true' ? true : false;
|
||||||
const overwrite = core.getInput('overwrite') == 'true' ? true : false;
|
const overwrite = core.getInput('overwrite') == 'true' ? true : false;
|
||||||
const prerelease = core.getInput('prerelease') == 'true' ? true : false;
|
const prerelease = core.getInput('prerelease') == 'true' ? true : false;
|
||||||
|
|||||||
8
package-lock.json
generated
8
package-lock.json
generated
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "upload-release-action",
|
"name": "upload-release-action",
|
||||||
"version": "1.0.2",
|
"version": "2.0.0",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -6664,9 +6664,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"lodash": {
|
"lodash": {
|
||||||
"version": "4.17.15",
|
"version": "4.17.19",
|
||||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz",
|
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz",
|
||||||
"integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==",
|
"integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"lodash.memoize": {
|
"lodash.memoize": {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "upload-release-action",
|
"name": "upload-release-action",
|
||||||
"version": "2.0.0",
|
"version": "2.1.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"description": "Upload files to a GitHub release",
|
"description": "Upload files to a GitHub release",
|
||||||
"main": "lib/main.js",
|
"main": "lib/main.js",
|
||||||
|
|||||||
@@ -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
|
// 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 token = core.getInput('repo_token', {required: true})
|
||||||
const file = core.getInput('file', {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 file_glob = core.getInput('file_glob') == 'true' ? true : false
|
||||||
const overwrite = core.getInput('overwrite') == 'true' ? true : false
|
const overwrite = core.getInput('overwrite') == 'true' ? true : false
|
||||||
|
|||||||
Reference in New Issue
Block a user