プレイグラウンド、サンドボックス、使い捨てスクリプト置き場
0

Configure Feed

Select the types of activity you want to include in your feed.

create update-latest-release action

Kohei Watanabe (Oct 30, 2023, 4:40 PM +0900) 24ac4ed7 5f09fbed

+29
+29
.github/workflows/update-latest-release.yml
··· 1 + name: update-latest-release 2 + on: 3 + workflow_dispatch: 4 + jobs: 5 + main: 6 + runs-on: ubuntu-latest 7 + steps: 8 + - uses: actions/checkout@v4 9 + - run: echo ok > hello.txt 10 + # - uses: actions/github-script@v6 11 + # with: 12 + # script: | 13 + # const { data: release } = await github.rest.repos.getLatestRelease(context.repo); 14 + 15 + # const name = "hello.txt"; 16 + # const data = await require("node:fs").promises.readFile(name); 17 + 18 + # await github.rest.repos.uploadReleaseAsset({ 19 + # ...context.repo, 20 + # release_id: release.id, 21 + # name, 22 + # data, 23 + # }); 24 + - run: | 25 + latest=$(gh release view --json tagName --jq .tagName) 26 + gh release delete-asset "${latest}" hello.txt || : 27 + gh release upload "${latest}" hello.txt 28 + env: 29 + GH_TOKEN: ${{ github.token }}