chore: run LeetCode directory writer on `main` only

This commit is contained in:
David Leal 2023-06-14 10:18:38 -06:00 committed by GitHub
parent b6b01a3605
commit 8a3ff966e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -5,6 +5,8 @@ on:
push: push:
paths: paths:
- "leetcode/src/**.c" - "leetcode/src/**.c"
branches:
- main
jobs: jobs:
build: build:
if: github.repository == 'TheAlgorithms/C' # We only need this to run in our repository. if: github.repository == 'TheAlgorithms/C' # We only need this to run in our repository.
@ -37,6 +39,7 @@ jobs:
shell: bash shell: bash
run: | run: |
if [[ `git status --porcelain` ]]; then 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).' 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).'
fi
env: env:
GH_TOKEN: ${{ github.token }} GH_TOKEN: ${{ github.token }}