Skip to content

Commit

Permalink
Refactor how we push to main from Action (#411)
Browse files Browse the repository at this point in the history
* adding pip install

* refactored how we push changes in yaml
  • Loading branch information
HowieG authored Sep 19, 2024
1 parent fc55b93 commit bf0effb
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions .github/workflows/add-notebook-examples-to-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ on:

workflow_dispatch:

permissions:
contents: write

jobs:
add-notebook-examples-to-docs:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -52,15 +55,14 @@ jobs:
fi
done
- name: Commit changes
- name: Add, commit, and push changes
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git config --global user.name 'Howard Gil'
git config --global user.email '[email protected]'
git add docs/v1/examples/*.mdx
git diff --quiet && git diff --staged --quiet || git commit -m "GitHub Action: Update examples in docs from notebooks"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: main
if git diff --staged --quiet; then
echo "No changes to commit"
else
git commit -m "GitHub Action: Update examples in docs from notebooks"
git push
fi

0 comments on commit bf0effb

Please sign in to comment.