Merge branch 'master' into dynamic_programming_cmake

This commit is contained in:
David Leal 2023-06-13 10:45:00 -06:00 committed by GitHub
commit c7472083e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 9 deletions

View File

@ -7,6 +7,7 @@ on:
- "leetcode/src/**.c"
jobs:
build:
if: github.repository == 'TheAlgorithms/C' # We only need this to run in our repository.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
@ -21,17 +22,21 @@ jobs:
- name: Write LeetCode DIRECTORY.md
run: |
python3 scripts/leetcode_directory_md.py 2>&1 | tee leetcode/DIRECTORY.md
- 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
- name: Setup Git configurations
shell: bash
if: steps.commit-push.outputs.changes_detected == 'true'
run: |
git config --global user.name github-actions[bot]
git config --global user.email 'github-actions@users.noreply.github.com'
- name: Committing changes
shell: bash
run: |
git checkout -b leetcode-directory-${{ github.sha }}
git commit -m "docs: updating `leetcode/DIRECTORY.md`
git push origin leetcode-directory-${{ github.sha }}:leetcode-directory-${{ github.sha }}
- name: Creating the pull request
shell: bash
run: |
if [[ `git status --porcelain` ]]; then
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).'
env:
GH_TOKEN: ${{ github.token }}