diff --git a/.github/workflows/leetcode_directory_writer.yml b/.github/workflows/leetcode_directory_writer.yml index 16cb656b..d2657333 100644 --- a/.github/workflows/leetcode_directory_writer.yml +++ b/.github/workflows/leetcode_directory_writer.yml @@ -18,13 +18,22 @@ jobs: - name: Add python dependencies run: | pip install requests - - name: Write leectode DIRECTORY.md + - name: Write LeetCode 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 + git pull || true + - name: Commit and push changes + uses: stefanzweifel/git-auto-commit-action@v4 + id: commit-push + with: + commit_message: "docs: updating `leetcode/DIRECTORY.md`" + branch: "leetcode-directory-${{ github.sha }}" + create_branch: true + - name: Creating and merging the PR + shell: bash + if: steps.commit-push.outputs.changes_detected == 'true' run: | - git add leetcode/DIRECTORY.md - git commit -am "updating DIRECTORY.md" || true - git push origin HEAD:$GITHUB_REF || true + gh pr create --base ${GITHUB_REF##*/} --head leetcode-directory-${{ github.sha }} --title 'docs: updating `leetcode/DIRECTORY.md`' --body 'Updated LeetCode directory (see the diff. for changes).' + gh pr merge --admin --merge --subject 'docs: updating `leetcode/DIRECTORY.md' --delete-branch + env: + GH_TOKEN: ${{ github.token }} diff --git a/DIRECTORY.md b/DIRECTORY.md index 9a51282a..2aba056d 100644 --- a/DIRECTORY.md +++ b/DIRECTORY.md @@ -2,6 +2,9 @@ ## Audio * [Alaw](https://github.com/TheAlgorithms/C/blob/HEAD/audio/alaw.c) +## Cipher + * [Rot13](https://github.com/TheAlgorithms/C/blob/HEAD/cipher/rot13.c) + ## Client Server * [Client](https://github.com/TheAlgorithms/C/blob/HEAD/client_server/client.c) * [Remote Command Exec Udp Client](https://github.com/TheAlgorithms/C/blob/HEAD/client_server/remote_command_exec_udp_client.c) @@ -359,7 +362,6 @@ * [Poly Add](https://github.com/TheAlgorithms/C/blob/HEAD/misc/poly_add.c) * [Postfix Evaluation](https://github.com/TheAlgorithms/C/blob/HEAD/misc/postfix_evaluation.c) * [Quartile](https://github.com/TheAlgorithms/C/blob/HEAD/misc/quartile.c) - * [Rot13](https://github.com/TheAlgorithms/C/blob/HEAD/misc/rot13.c) * [Rselect](https://github.com/TheAlgorithms/C/blob/HEAD/misc/rselect.c) * [Run Length Encoding](https://github.com/TheAlgorithms/C/blob/HEAD/misc/run_length_encoding.c) * [Shunting Yard](https://github.com/TheAlgorithms/C/blob/HEAD/misc/shunting_yard.c)