GitHub Actionsで井戸端プロジェクトのバックアップを取得しReleaseに登録する
お願いします!

schedule
で時間実行
workflow_dispatch
で手動トリガー実行
Tagとして日付を入れておけばよさそう
差分を見たかったので、repoに直接pushしていた
repoに入れるのと同時にreleaseでjsonを生成するのも便利そう
.github/workflows/scheduled-build.ymlname: Scheduled build
on:
schedule:
- cron: 0 18 * * *
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v2
- uses: denoland/setup-deno@v1
- name: Backup data
run: >
deno run
--allow-read
--allow-net
--allow-write
--no-check
index.ts
|
と
>
の違いはなんでしょうか?

すみません、参考元で利用していたので、安易に使っていました

|
は複数行を処理するのに利用するという理解でしたが、 >
はとりあえず真似した感じです
要調査 調べました

ありがとうございます!

>
: 改行コードが無視されて、1つのコマンドとして実行
> this is my very very very
this is my very very very long string\n
|
: それぞれ改行コードが入るので、並べれば複数コマンド実行
> this is my very very very
this is my very very very\nlong string\n
なるほど~。
|
が
\
\
(JS)や
@""
(C#)などの生文字列リテラル相当の記号になるんですね

.github/workflows/scheduled-build.yml - name: Zip
run: zip data data.json
- name: Set Date
env:
TZ: "Asia/Tokyo"
run: echo "CURRENT_DATETIME=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
- name: Release
uses: ncipollo/release-action@v1
with:
artifacts: "data.zip"
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ env.CURRENT_DATETIME }}
利用制限に引っかかるかどうか
マイニングではない
>disrupting, gaining, or attempting to gain unauthorized access to, any service, device, data, account, or network (other than those authorized by the GitHub Bug Bounty program);
非該当
>the provision of a stand-alone or integrated application or service offering the Actions product or service, or any elements of the Actions product or service, for commercial purposes;
商用利用でもないので非該当
>any activity that places a burden on our servers, where that burden is disproportionate to the benefits provided to users (for example, don't use Actions as a content delivery network or as part of a serverless application, but a low benefit Action could be ok if it’s also low burden); or
負担も少ないはず
>if using GitHub-hosted runners, any other activity unrelated to the production, testing, deployment, or publication of the software project associated with the repository where GitHub Actions are used.
無関係ではない・・はず。
repoにもページデータをpushすれば無関係じゃなくなる

2022/11/27
ページごとにjsonを分割してコミットするようにした

ファイル名にタイトルを使おうと思っていたが、結局ページのidを使うようにした
参考