1 Commits

Author SHA1 Message Date
80663ccda0 Update php Docker tag to v8.5.0
All checks were successful
renovate/stability-days Updates have met minimum release age requirement
lint-test-helm / helm-lint (pull_request) Successful in 20s
2025-11-30 21:26:10 +00:00

View File

@@ -70,7 +70,7 @@ jobs:
# - name: Create Pull Request
# id: pull-request
# uses: github.com/quentinlegot/gitea-create-pull-request@c05fb67b080696dcdb2d2b7ea83051ec413f7285
# uses: peter-evans/create-pull-request@v7
# with:
# token: ${{ secrets.BOT_TOKEN }}
# add-paths: |
@@ -94,11 +94,8 @@ jobs:
- name: Check for Changes
id: check-changes
run: |
git restore --staged ${{ gitea.workspace }}/clusters/**/helm
if git status --porcelain | grep -q .; then
echo ">> Changes detected"
git status --porcelain
echo "changes-detected=true" >> $GITEA_OUTPUT
else
echo ">> No changes detected, skipping PR creation"
@@ -112,19 +109,16 @@ jobs:
BRANCH_NAME="auto/update-manifests-$(date +%s)"
# Configure Git
echo ">> Configure git to use gitea-bot as user ..."
git config user.name "gitea-bot"
git config user.email "gitea-bot@alexlebens.net"
# Create a new branch and stage all changes
echo ">> Creating and commiting to $BRANCH_NAME ..."
git checkout -b $BRANCH_NAME
git add .
git commit -m "chore: Update manifests after change"
# Push the new branch to the remote 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
echo "HEAD_BRANCH=$BRANCH_NAME" >> $GITEA_OUTPUT
@@ -136,56 +130,23 @@ jobs:
env:
GITEA_TOKEN: ${{ secrets.BOT_TOKEN }}
GITEA_URL: ${{ secrets.REPO_URL }}
OWNER: ${{ gitea.repository_owner }}
REPO: ${{ gitea.repository_name }}
HEAD_BRANCH: ${{ steps.commit-push.outputs.HEAD_BRANCH }}
run: |
API_ENDPOINT="${GITEA_URL}/api/v1/repos/${{ gitea.repository_owner }}/${{ gitea.repository_name }}/pulls"
PAYLOAD=$(cat <<-EOF
{
"head": "${HEAD_BRANCH}",
"base": "${BASE_BRANCH}",
"title": "Automated Manifest Update: $(date +%F)",
"body": "This PR contains newly rendered Kubernetes manifests automatically generated by the CI workflow.",
}
EOF
)
echo ">> Creating PR from branch: ${HEAD_BRANCH} into ${BASE_BRANCH}"
HTTP_STATUS=$(
curl -X POST \
-H "Authorization: token ${GITEA_TOKEN}" \
-H "Content-Type: application/json" \
--data "${PAYLOAD}" \
"${API_ENDPOINT}" 2> /dev/stdout \
| tee /tmp/pr_response.json \
| head -n 1
)
apt update && apt install tea
echo ">> Gitea API Response Body ...
echo "----
cat /tmp/pr_response.json
echo "----
tea pulls create \
--repo "${OWNER}/${REPO}" \
--head "${HEAD_BRANCH}" \
--base "${BASE_BRANCH}" \
--title "Automated Manifest Update: $(date +%F)" \
--body "This PR contains newly rendered Kubernetes manifests automatically generated by the CI workflow."
if [ "$HTTP_STATUS" == "201" ]; then
echo ">> Pull Request created successfully!"
PR_URL=$(cat /tmp/pr_response.json | jq -r .html_url)
echo "pull-request-url=${PR_URL}" >> $GITEA_OUTPUT
echo "pull-request-operation=created" >> $GITEA_OUTPUT
elif [ "$HTTP_STATUS" == "422" ]; then
echo ">> Failed to create PR (HTTP 422: Unprocessable Entity), PR may already exist"
else
echo ">> Failed to create PR, HTTP status code: $HTTP_STATUS"
echo ">> Removing branch: ${HEAD_BRANCH}"
git push origin --delete ${HEAD_BRANCH}
exit 1
fi
# - name: ntfy Created
# uses: niniyas/ntfy-action@master
# if: steps.create-pull-request.outputs.pull-request-operation == 'created'