Merge #1132
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: Merge | |
# Controls when the action will run. | |
on: | |
schedule: | |
- cron: '0 17 * * *' | |
# 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: ubuntu-latest | |
# 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@v2 | |
# Runs a set of commands using the runners shell | |
- name: make date dir and archieve the post files | |
run: | | |
dir_name=`date --date= +%Y/%m/%d` | |
export TARGET_PATH="md" | |
if [[ ! -d $TARGET_PATH || `ls -A $TARGET_PATH` == '' ]]; then | |
echo "date : $dir_name not have collect articles" | |
exit 0 | |
fi | |
git config --global user.name "RobertWang" | |
git config --global user.email "[email protected]" | |
dir_name=`date --date= +%Y/%m/%d` | |
mkdir -p $dir_name | |
mv md/* $dir_name/ | |
git add . | |
git commit -am "$dir_name 每日归档" | |
git push -f |