Skip to content

ci: test workflow

ci: test workflow #3

Workflow file for this run

name: Count
on:
push:
workflow_dispatch:
schedule:
- cron: '*/5 * * * *'
jobs:
count:
name: Count
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.ref_name }}
- name: Count files
id: count_files
run: |
file_count=$(find . -type f | wc -l)
echo "File count: $file_count"
echo "::set-output name=file_count::$file_count"
- name: Update README
run: |
file_count=${{ steps.count_files.outputs.file_count }}
readme_content=$(cat << EOF
# LeetCode
Try hard leet code every day to improve level
[ Leetcode profile ](https://leetcode.com/u/orgball2608/)
## Problem solved
**$file_count** problem.
EOF
)
echo "$readme_content" > README.md
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Update README with file count
commit_author: GitHub <41898282+github-actions[bot]@users.noreply.github.com>
branch: ${{ github.ref_name }}