-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
41 additions
and
6 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
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/sh -l | ||
git add entrypoint.sh | ||
git update-index --chmod=+x entrypoint.sh | ||
|
||
README_PATH=${1:-README.md} | ||
|
||
# Update the README file as needed | ||
echo "Updating $README_PATH with code snippets..." | ||
|
||
python3 main.py | ||
|
||
# Check if there are changes to commit | ||
if [ -n "$(git status -s)" ]; then # Use [ ] instead of [[ ]] | ||
git config --global user.name "github-actions" | ||
git config --global user.email "[email protected]" | ||
|
||
# Ensure we're in the correct directory | ||
cd "$GITHUB_WORKSPACE" # This is the default location for the checked out repo | ||
|
||
git add "$README_PATH" | ||
|
||
# Check if there are changes to commit | ||
if ! git diff-index --quiet HEAD --; then | ||
git commit -m "Update $README_PATH" | ||
git push origin HEAD:${GITHUB_REF} # Push changes to the current branch | ||
else | ||
echo "No changes to commit." | ||
fi | ||
else | ||
echo "No changes to commit." | ||
fi |
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
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