Skip to content

Scan and Push

Scan and Push #402

# nothing
name: Scan and Push
# daily job
on:
workflow_dispatch:
schedule:
- # daily job at 4 AM with UTC time
cron: "0 4 * * *"
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: self-hosted
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 18
- name: Setup Git Infomation
run: |
git config --global user.name 'bot'
git config --global user.email 'robotTest@github.com'
- name: Recording
run: |
npm install --global yarn && yarn install
node .
git add -f ./result.txt
git diff --quiet && git diff --staged --quiet || git commit -m "update result.txt"
- name: Pushing
run: |
git push https://${{github.actor}}:${{secrets.GITHUB_TOKEN}}@github.com/${{github.repository}}.git HEAD:${{ github.ref }} || echo "No changes to commit"