-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
3436f53
commit d265955
Showing
3 changed files
with
70 additions
and
3 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 |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#!/bin/bash | ||
|
||
# Exit on any error | ||
set -e | ||
set -x # Enable debugging output | ||
|
||
# Set environment variables | ||
export GITHUB_TOKEN=your_github_token | ||
export GITHUB_REPO=github.com/diegoabeltran16/Medical-Interpreter-Bot.git | ||
|
||
# Configure Git credential helper to store credentials temporarily | ||
git config --global credential.helper cache | ||
|
||
# Print environment variables for debugging | ||
echo "GITHUB_REPO: ${GITHUB_REPO}" | ||
|
||
# Verify that environment variables are set | ||
if [ -z "$GITHUB_REPO" ]; then | ||
echo "Error: GITHUB_REPO is not set" | ||
exit 1 | ||
fi | ||
|
||
# Configure Git | ||
git config --global user.email "diegobeltran1016@gmail.com" | ||
git config --global user.name "Diego Alejandro Beltran" | ||
|
||
# Remove remotes if they exist (to ensure clean state) | ||
git remote remove github || true | ||
|
||
# Add GitHub as a remote | ||
git remote add github "https://${GITHUB_TOKEN}@${GITHUB_REPO}" | ||
echo "GitHub remote added." | ||
|
||
# Fetch all branches from GitHub | ||
echo "Fetching branches from GitHub..." | ||
git fetch github || echo "Failed to fetch from GitHub. Check the repository URL and token permissions." | ||
|
||
# Checkout main branch | ||
git checkout main | ||
|
||
# Merge feature branches into main | ||
for branch in $(git branch -r | grep 'github/feature/' | sed 's/github\///'); do | ||
echo "Merging ${branch} into main..." | ||
git merge "$branch" --no-ff -m "Merge ${branch} into main" | ||
done | ||
|
||
# Push the updated main branch to GitHub | ||
echo "Pushing changes to GitHub..." | ||
if git push github main; then | ||
echo "Pushed changes to GitHub successfully." | ||
else | ||
echo "Failed to push changes to GitHub." | ||
fi | ||
|
||
echo "Feature branches merged and pushed to GitHub successfully." |
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 |
---|---|---|
|
@@ -5,4 +5,5 @@ schedule | |
spacy | ||
transformers | ||
python-dotenv | ||
openai | ||
openai | ||
flake8 |