Compare commits

..

9 Commits

Author SHA1 Message Date
t.behrendt 1734e79a40 ci: add workflow to add autobumps (#102)
CD / Release (push) Successful in 56s
Reviewed-on: #102
Co-authored-by: Timo Behrendt <t.behrendt@t00n.de>
Co-committed-by: Timo Behrendt <t.behrendt@t00n.de>
2026-07-24 18:32:35 +02:00
t.behrendt 832b956560 feat(actions): allow automerge of actions/setup-go v7 (#101)
CD / Release (push) Successful in 46s
Reviewed-on: #101
Co-authored-by: Timo Behrendt <t.behrendt@t00n.de>
Co-committed-by: Timo Behrendt <t.behrendt@t00n.de>
2026-07-23 21:22:40 +02:00
t.behrendt f9b9763a3c feat(actions): allow automerge of actions/setup-node v7 (#99)
CD / Release (push) Successful in 5s
Reviewed-on: #99
Co-authored-by: t.behrendt <t.behrendt@t00n.de>
Co-committed-by: t.behrendt <t.behrendt@t00n.de>
2026-07-21 07:48:38 +02:00
renovate-bot cd0ba86fed chore(deps): update https://gitea.t000-n.de/t.behrendt/actions action to v0.2.11 (#98)
CD / Release (push) Successful in 3s
Co-authored-by: Renovate Bot <renovate@t00n.de>
Co-committed-by: Renovate Bot <renovate@t00n.de>
2026-07-19 07:10:05 +02:00
renovate-bot 61ebe3035b chore(deps): update actions (#97)
CD / Release (push) Successful in 11s
Co-authored-by: Renovate Bot <renovate@t00n.de>
Co-committed-by: Renovate Bot <renovate@t00n.de>
2026-07-19 06:10:51 +02:00
renovate-bot fe779d7bf8 chore(deps): update https://gitea.t000-n.de/t.behrendt/conventional-semantic-git-tag-increment action to v0.1.41 (#96)
CD / Release (push) Successful in 3s
Co-authored-by: Renovate Bot <renovate@t00n.de>
Co-committed-by: Renovate Bot <renovate@t00n.de>
2026-07-18 10:42:34 +02:00
renovate-bot 77c53788a5 chore(deps): update https://gitea.t000-n.de/t.behrendt/actions action to v0.2.9 (#95)
CD / Release (push) Successful in 4s
Co-authored-by: Renovate Bot <renovate@t00n.de>
Co-committed-by: Renovate Bot <renovate@t00n.de>
2026-07-18 07:33:23 +02:00
renovate-bot 6ee7e86b0b chore(deps): update https://gitea.t000-n.de/t.behrendt/conventional-semantic-git-tag-increment action to v0.1.40 (#94)
CD / Release (push) Successful in 4s
Co-authored-by: Renovate Bot <renovate@t00n.de>
Co-committed-by: Renovate Bot <renovate@t00n.de>
2026-07-18 07:08:35 +02:00
t.behrendt 59f5f6e54f fix: skip minimum release age for internal docker deps (#92)
CD / Release (push) Successful in 20s
Reviewed-on: #92
Co-authored-by: t.behrendt <t.behrendt@t00n.de>
Co-committed-by: t.behrendt <t.behrendt@t00n.de>
2026-07-13 07:14:59 +02:00
4 changed files with 181 additions and 3 deletions
+156
View File
@@ -0,0 +1,156 @@
name: Add autobump
on:
workflow_dispatch:
inputs:
description:
description: Description for the package rule
required: true
type: string
ecosystem:
description: Ecosystem
required: true
type: choice
options:
- action
- golang
- bun-npm
matchUpdateType:
description: Update type to allow
required: true
type: choice
default: major
options:
- major
- minor
- patch
matchPackageName:
description: Package name to allow autobump for
required: true
type: string
matchNewValue:
description: New value pattern (e.g. v7.* or v7.0.0)
required: true
type: string
jobs:
allow-autobump:
name: Allow autobump
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
token: ${{ secrets.GITEA_TOKEN }}
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version-file: ".bun-version"
- run: bun install --frozen-lockfile
- name: Add package rule
id: rule
env:
DESCRIPTION: ${{ inputs.description }}
ECOSYSTEM: ${{ inputs.ecosystem }}
MATCH_UPDATE_TYPE: ${{ inputs.matchUpdateType }}
MATCH_PACKAGE_NAME: ${{ inputs.matchPackageName }}
MATCH_NEW_VALUE: ${{ inputs.matchNewValue }}
run: |
set -euo pipefail
FILE="${ECOSYSTEM}.json"
if [[ ! -f "${FILE}" ]]; then
echo "::error::Config file ${FILE} does not exist"
exit 1
fi
MATCH_MANAGERS="$(jq -nc --arg e "${ECOSYSTEM}" '{
"action": ["github-actions"],
"golang": ["gomod"],
"helm": ["helm-values"],
"k8s": ["kubernetes"],
"bun-npm": ["npm", "bun"],
"docker-compose": ["docker-compose"]
}[$e]')"
if [[ "${MATCH_MANAGERS}" == "null" || -z "${MATCH_MANAGERS}" ]]; then
echo "::error::Unknown ecosystem: ${ECOSYSTEM}"
exit 1
fi
if [[ -z "${DESCRIPTION}" ]]; then
DESCRIPTION="Automerge ${MATCH_UPDATE_TYPE} updates for ${MATCH_PACKAGE_NAME} to ${MATCH_NEW_VALUE}"
fi
jq \
--arg desc "${DESCRIPTION}" \
--argjson managers "${MATCH_MANAGERS}" \
--arg updateType "${MATCH_UPDATE_TYPE}" \
--arg packageName "${MATCH_PACKAGE_NAME}" \
--arg newValue "${MATCH_NEW_VALUE}" \
'
.packageRules = ((.packageRules // []) + [{
description: $desc,
matchManagers: $managers,
matchUpdateTypes: [$updateType],
matchPackageNames: [$packageName],
matchNewValue: $newValue,
automerge: true,
platformAutomerge: true,
automergeType: "pr",
addLabels: ["automerge"]
}])
' "${FILE}" > "${FILE}.tmp"
mv "${FILE}.tmp" "${FILE}"
SAFE_PKG="$(printf '%s' "${MATCH_PACKAGE_NAME}" | tr '/:' '--' | tr -cd '[:alnum:]._-')"
SAFE_VAL="$(printf '%s' "${MATCH_NEW_VALUE}" | tr '/:*' '---' | tr -cd '[:alnum:]._-')"
BRANCH="chore/allow-autobump-${ECOSYSTEM}-${SAFE_PKG}-${SAFE_VAL}"
TITLE="feat(${ECOSYSTEM}): allow automerge of ${MATCH_PACKAGE_NAME} ${MATCH_NEW_VALUE}"
{
echo "file=${FILE}"
echo "branch=${BRANCH}"
echo "title=${TITLE}"
echo "description=${DESCRIPTION}"
} >> "${GITHUB_OUTPUT}"
- run: bun run fmt
- name: Create pull request
env:
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
FILE: ${{ steps.rule.outputs.file }}
BRANCH: ${{ steps.rule.outputs.branch }}
TITLE: ${{ steps.rule.outputs.title }}
DESCRIPTION: ${{ steps.rule.outputs.description }}
SERVER_URL: ${{ github.server_url }}
REPOSITORY: ${{ github.repository }}
DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
run: |
set -euo pipefail
git config user.name "gitea-actions"
git config user.email "gitea-actions@noreply.local"
git checkout -b "${BRANCH}"
git add "${FILE}"
git commit -m "${TITLE}"
git push -u origin "HEAD:${BRANCH}"
BODY="$(printf 'Allow Renovate to automerge updates matching:\n\n- **Ecosystem:** `%s`\n- **Package:** `%s`\n- **Update type:** `%s`\n- **New value:** `%s`\n\n%s\n' \
"${{ inputs.ecosystem }}" \
"${{ inputs.matchPackageName }}" \
"${{ inputs.matchUpdateType }}" \
"${{ inputs.matchNewValue }}" \
"${DESCRIPTION}")"
RESPONSE="$(curl -sfS -X POST \
-H "Authorization: token ${GITEA_TOKEN}" \
-H "Content-Type: application/json" \
"${SERVER_URL}/api/v1/repos/${REPOSITORY}/pulls" \
-d "$(jq -n \
--arg title "${TITLE}" \
--arg head "${BRANCH}" \
--arg base "${DEFAULT_BRANCH}" \
--arg body "${BODY}" \
'{title: $title, head: $head, base: $base, body: $body}')")"
PR_URL="$(printf '%s' "${RESPONSE}" | jq -r '.html_url')"
echo "Created pull request: ${PR_URL}"
+2 -2
View File
@@ -16,10 +16,10 @@ jobs:
fetch-depth: 0 fetch-depth: 0
- name: Increment tag - name: Increment tag
id: tag id: tag
uses: https://gitea.t000-n.de/t.behrendt/conventional-semantic-git-tag-increment@e393dbb067c09fd43519392572ccf63b66cba92d # 0.1.39 uses: https://gitea.t000-n.de/t.behrendt/conventional-semantic-git-tag-increment@3ab82e6aa1db388a34562f5ce6eedb598651d916 # 0.1.42
with: with:
token: ${{ secrets.GITEA_TOKEN }} token: ${{ secrets.GITEA_TOKEN }}
prerelease: ${{ github.event_name == 'workflow_dispatch' }} prerelease: ${{ github.event_name == 'workflow_dispatch' }}
- uses: https://gitea.t000-n.de/t.behrendt/actions/release-git-tag@29f50ea246d5d9a62ac3c611fa5c8a6e9846df5a # 0.2.8 - uses: https://gitea.t000-n.de/t.behrendt/actions/release-git-tag@7f9ed2bccd9161d124284619464c5dc5b15b79c0 # 0.2.11
with: with:
tag: ${{ steps.tag.outputs.new-tag }} tag: ${{ steps.tag.outputs.new-tag }}
+22
View File
@@ -74,6 +74,28 @@
"platformAutomerge": true, "platformAutomerge": true,
"automergeType": "pr", "automergeType": "pr",
"addLabels": ["automerge"] "addLabels": ["automerge"]
},
{
"description": "Automerge major updates for actions/setup-node to v7.0.0",
"matchManagers": ["github-actions"],
"matchUpdateTypes": ["major"],
"matchPackageNames": ["actions/setup-node"],
"matchNewValue": "v7.*",
"automerge": true,
"platformAutomerge": true,
"automergeType": "pr",
"addLabels": ["automerge"]
},
{
"description": "Automerge major updates for actions/setup-go to v7",
"matchManagers": ["github-actions"],
"matchUpdateTypes": ["major"],
"matchPackageNames": ["actions/setup-go"],
"matchNewValue": "v7.*",
"automerge": true,
"platformAutomerge": true,
"automergeType": "pr",
"addLabels": ["automerge"]
} }
] ]
} }
+1 -1
View File
@@ -15,7 +15,7 @@
"packageRules": [ "packageRules": [
{ {
"description": "Don't update dependencies unless they are at least 7 days old (except for internal deps).", "description": "Don't update dependencies unless they are at least 7 days old (except for internal deps).",
"matchPackageNames": ["!t.behrendt/**", "gitea.t000-n.de/t.behrendt/**"], "matchPackageNames": ["!t.behrendt/**", "!gitea.t000-n.de/t.behrendt/**"],
"minimumReleaseAge": "7 days", "minimumReleaseAge": "7 days",
"minimumReleaseAgeBehaviour": "timestamp-required", "minimumReleaseAgeBehaviour": "timestamp-required",
"internalChecksFilter": "strict" "internalChecksFilter": "strict"