fetch-new #121
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: fetch-new | |
on: | |
workflow_dispatch: | |
inputs: | |
bvid: | |
description: 'Bilibili bvid' | |
default: 'err' | |
required: false | |
ytid: | |
description: 'youtube video id' | |
default: 'err' | |
required: false | |
schedule: | |
- cron: '0 22 * * *' | |
jobs: | |
fetch: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '20' | |
- name: add ts-node | |
run: npm install -g ts-node | |
- name: install dependencies | |
run: npm install | |
- name: run script | |
id: fetch | |
run: npm run get:new --bv ${{ github.event.inputs.bvid }} --yt ${{ github.event.inputs.ytid }} | |
- name: Get current date | |
id: date | |
run: echo "date=$(date +'%Y-%m-%d')" >> "$GITHUB_OUTPUT" | |
- name: Create Pull Request | |
id: cpr | |
uses: peter-evans/create-pull-request@v5 | |
with: | |
token: ${{ secrets.PAT }} | |
commit-message: ":memo: new btnews" | |
committer: GitHub <noreply@github.com> | |
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com> | |
signoff: false | |
delete-branch: true | |
branch: fetch-btnews/${{ steps.fetch.outputs.index }} | |
title: ':memo: new btnews ${{ steps.fetch.outputs.title }}' | |
add-paths: | | |
btnews/**/*.md | |
images/**/*.webp | |
body: | | |
new btnews ${{ steps.fetch.outputs.title }} | |
- Auto-generated by [create-pull-request][1] | |
[1]: https://github.com/peter-evans/create-pull-request | |
labels: | | |
btnews | |
automated pr | |
draft: false |