mirror of
https://github.com/kou029w/_.git
synced 2025-01-31 06:18:07 +00:00
create update-latest-release action
This commit is contained in:
parent
5f09fbedc1
commit
24ac4ed7b1
1 changed files with 29 additions and 0 deletions
29
.github/workflows/update-latest-release.yml
vendored
Normal file
29
.github/workflows/update-latest-release.yml
vendored
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
name: update-latest-release
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
jobs:
|
||||||
|
main:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- run: echo ok > hello.txt
|
||||||
|
# - uses: actions/github-script@v6
|
||||||
|
# with:
|
||||||
|
# script: |
|
||||||
|
# const { data: release } = await github.rest.repos.getLatestRelease(context.repo);
|
||||||
|
|
||||||
|
# const name = "hello.txt";
|
||||||
|
# const data = await require("node:fs").promises.readFile(name);
|
||||||
|
|
||||||
|
# await github.rest.repos.uploadReleaseAsset({
|
||||||
|
# ...context.repo,
|
||||||
|
# release_id: release.id,
|
||||||
|
# name,
|
||||||
|
# data,
|
||||||
|
# });
|
||||||
|
- run: |
|
||||||
|
latest=$(gh release view --json tagName --jq .tagName)
|
||||||
|
gh release delete-asset "${latest}" hello.txt || :
|
||||||
|
gh release upload "${latest}" hello.txt
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ github.token }}
|
Loading…
Add table
Reference in a new issue