TheAlgorithms-C/.github/workflows/leetcode_directory_writer.yml

31 lines
1013 B
YAML
Raw Normal View History

feat: Add LeetCode directory writer (#1187) * add leetcode_directory_writer * updating DIRECTORY.md * Update leetcode_directory_md.py add script header * updating DIRECTORY.md * updating DIRECTORY.md * Update .github/workflows/leetcode_directory_writer.yml Co-authored-by: David Leal <halfpacho@gmail.com> * Update .github/workflows/leetcode_directory_writer.yml Co-authored-by: David Leal <halfpacho@gmail.com> * Update .github/workflows/leetcode_directory_writer.yml Co-authored-by: David Leal <halfpacho@gmail.com> * Update .github/workflows/leetcode_directory_writer.yml Co-authored-by: David Leal <halfpacho@gmail.com> * Update .github/workflows/leetcode_directory_writer.yml Co-authored-by: David Leal <halfpacho@gmail.com> * updating DIRECTORY.md * Update .github/workflows/leetcode_directory_writer.yml Co-authored-by: David Leal <halfpacho@gmail.com> * updating DIRECTORY.md * Update .github/workflows/leetcode_directory_writer.yml Co-authored-by: David Leal <halfpacho@gmail.com> * updating DIRECTORY.md * updating DIRECTORY.md * Update .github/workflows/leetcode_directory_writer.yml Co-authored-by: Taj <tjgurwara99@users.noreply.github.com> * Update scripts/leetcode_directory_md.py Co-authored-by: Taj <tjgurwara99@users.noreply.github.com> * Update scripts/leetcode_directory_md.py Co-authored-by: Taj <tjgurwara99@users.noreply.github.com> * Update scripts/leetcode_directory_md.py Co-authored-by: Taj <tjgurwara99@users.noreply.github.com> * fix formating * updating DIRECTORY.md * updating DIRECTORY.md Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com> Co-authored-by: David Leal <halfpacho@gmail.com> Co-authored-by: github-actions[bot] <github-actions@users.noreply.github.com> Co-authored-by: Taj <tjgurwara99@users.noreply.github.com>
2023-01-24 01:24:50 +08:00
# The objective of this GitHub Action is to update the leetcode DIRECTORY.md file (if needed)
# when doing a git push
name: leetcode_directory_writer
on:
push:
paths:
- "leetcode/src/**.c"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-python@v4
with:
python-version: 3.x
- name: Add python dependencies
run: |
pip install requests
- name: Write leectode DIRECTORY.md
run: |
python3 scripts/leetcode_directory_md.py 2>&1 | tee leetcode/DIRECTORY.md
git config --global user.name github-actions[bot]
git config --global user.email 'github-actions@users.noreply.github.com'
- name: Update LeetCode's directory
run: |
git add leetcode/DIRECTORY.md
git commit -am "updating DIRECTORY.md" || true
git push origin HEAD:$GITHUB_REF || true