-
Notifications
You must be signed in to change notification settings - Fork 255
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor how we push to main from Action (#411)
* adding pip install * refactored how we push changes in yaml
- Loading branch information
Showing
1 changed file
with
12 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,9 @@ on: | |
|
||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
add-notebook-examples-to-docs: | ||
runs-on: ubuntu-latest | ||
|
@@ -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 |