Compare commits
1 Commits
c1898ba057
...
49cdfa2e91
| Author | SHA1 | Date | |
|---|---|---|---|
|
49cdfa2e91
|
@@ -42,12 +42,13 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
cd ${MANIFEST_DIR}
|
cd ${MANIFEST_DIR}
|
||||||
|
|
||||||
|
# Configure Git
|
||||||
echo ">> Configure git to use gitea-bot as user ..."
|
echo ">> Configure git to use gitea-bot as user ..."
|
||||||
git config user.name "gitea-bot"
|
git config user.name "gitea-bot"
|
||||||
git config user.email "gitea-bot@alexlebens.net"
|
git config user.email "gitea-bot@alexlebens.net"
|
||||||
|
|
||||||
echo ">> Checking if PR branch exists ..."
|
# Check if pr branch exists
|
||||||
git ls-remote --exit-code --heads origin "${BRANCH_NAME}" > /dev/null 2>&1 || true
|
git ls-remote --exit-code --heads origin "${BRANCH_NAME}" > /dev/null 2>&1
|
||||||
|
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo ">> Branch '${BRANCH_NAME}' exists, pulling changes ..."
|
echo ">> Branch '${BRANCH_NAME}' exists, pulling changes ..."
|
||||||
@@ -60,7 +61,7 @@ jobs:
|
|||||||
git checkout -b $BRANCH_NAME
|
git checkout -b $BRANCH_NAME
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo ">> Remove manfiest files and rebuild from source ..."
|
# Removing manifest files to account for any deletions and rebuilt from source
|
||||||
cd ${MANIFEST_DIR}/clusters
|
cd ${MANIFEST_DIR}/clusters
|
||||||
rm -rf ./*
|
rm -rf ./*
|
||||||
|
|
||||||
@@ -136,12 +137,14 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
cd ${MANIFEST_DIR}
|
cd ${MANIFEST_DIR}
|
||||||
|
|
||||||
echo ">> Commiting changes to ${BRANCH_NAME} ..."
|
# Add all changes
|
||||||
|
echo ">> Commiting to ${BRANCH_NAME} ..."
|
||||||
git add .
|
git add .
|
||||||
git commit -m "chore: Update manifests after change"
|
git commit -m "chore: Update manifests after change"
|
||||||
|
|
||||||
echo ">> Pushing changes to $REPO_URL ..."
|
# Push the new branch to the remote repository
|
||||||
REPO_URL="${{ secrets.REPO_URL }}/${{ gitea.repository }}"
|
REPO_URL="${{ secrets.REPO_URL }}/${{ gitea.repository }}"
|
||||||
|
echo ">> Pushing changes to $REPO_URL ..."
|
||||||
git push -u "https://oauth2:${{ secrets.BOT_TOKEN }}@$(echo $REPO_URL | sed -e 's|https://||')" ${BRANCH_NAME}
|
git push -u "https://oauth2:${{ secrets.BOT_TOKEN }}@$(echo $REPO_URL | sed -e 's|https://||')" ${BRANCH_NAME}
|
||||||
|
|
||||||
echo "HEAD_BRANCH=${BRANCH_NAME}" >> $GITEA_OUTPUT
|
echo "HEAD_BRANCH=${BRANCH_NAME}" >> $GITEA_OUTPUT
|
||||||
|
|||||||
Reference in New Issue
Block a user