Skip to content

添加图片

添加图片 #43

Workflow file for this run

name: list
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
push:
branches: [ "master" ]
paths-ignore:
- '.github/**'
- 'config.json'
- 'README.md'
- 'list/**'
pull_request:
branches: [ "master" ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# 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"
list:
# The type of runner that the job will run on
runs-on: ubuntu-20.04
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Encoding
run: |
git config --global i18n.logoutputencoding utf-8
git config --global i18n.commitencoding utf-8
git config --global core.quotepath false
export LESSCHARSET=utf-8
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout
uses: actions/checkout@v3
with:
# We need to fetch all branches and commits so that Nx affected has a base to compare against.
fetch-depth: 0
# - name: Last Success SHA
# uses: nrwl/nx-set-shas@v3
# id: sha
# with:
# main-branch-name: "master"
- name: Last Success SHA
id: get-base-sha
run: |
echo "base_sha=$(cat .github/.sha)" >> $GITHUB_OUTPUT
- name: List files
id: changed-files
# 新版本路径变化太大,没心情去适配
uses: tj-actions/changed-files@v35
with:
base_sha: ${{ steps.get-base-sha.outputs.base_sha }}
# fetch_depth: 1
quotepath: "false"
write_output_files: true
separator: "______"
old_new_files_separator: "______"
include_all_old_new_renamed_files: true
files_ignore: |
config.json
README.md
.github/**
list/**
- name: Echo files
run: |
cp .github/outputs/added_files.txt add.list
cp .github/outputs/all_old_new_renamed_files.txt rename.list
cp .github/outputs/deleted_files.txt delete.list
- name: Update
env:
CSRF: ${{ secrets.CSRF }}
SESSDATA: ${{ secrets.SESSDATA }}
# ubuntu 又出问题了,只能换种方式了
run: |
cd .github/workflows
npm i axios ffmpeg-static fluent-ffmpeg
node list.js && echo $GITHUB_SHA > ../.sha
- name: Push
run: |
rm -rf rename.list add.list delete.list .github/workflows/node_modules/ .github/workflows/package-lock.json .github/workflows/package.json
if [ -n "$(git status -s list)" ];then
git status
git config user.email "[email protected]"
git config user.name "Action Robot"
git add list .github/.sha
git commit -m "Update List By Action Robot"
git push
fi
# uses: actions-x/commit@v6
# with:
# email: [email protected]
# name: Action Robot
# message: "Update List By Action Robot"
# branch: master
# files: list