1
0
Fork 0
mirror of https://github.com/kou029w/_.git synced 2025-02-04 16:18:41 +00:00

Compare commits

..

3 commits

Author SHA1 Message Date
dependabot[bot]
63fad4fa48
Merge 8b6f15e55b into 962b721a24 2023-10-30 09:45:02 +00:00
962b721a24
create update-empty-branch 2023-10-30 17:44:00 +09:00
24ac4ed7b1
create update-latest-release action 2023-10-30 16:40:54 +09:00
2 changed files with 37 additions and 12 deletions

View file

@ -0,0 +1,18 @@
name: update-empty-branch
on:
workflow_dispatch:
jobs:
main:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: |
git worktree add --track -b empty empty origin/empty
rm -rf empty/*
git config user.name bot
git config user.email '<>'
git -C empty add --all
git -C empty commit --allow-empty --message "based on $(git rev-parse @)"
git -C empty push origin empty

View file

@ -5,18 +5,25 @@ 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);
# - 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);
# 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,
});
# 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 }}