commit 1f1ce72793b01aaf49cf761c184e87604ce5b4b9 Author: Joseph Hanson Date: Wed May 15 08:59:54 2024 -0500 Add renovate. diff --git a/.forgejo/actions/renovate/action.yaml b/.forgejo/actions/renovate/action.yaml new file mode 100644 index 0000000..6bdd2a0 --- /dev/null +++ b/.forgejo/actions/renovate/action.yaml @@ -0,0 +1,59 @@ +# action.yml +name: renovate +description: 'renovate with caching' + +inputs: + endpoint: + description: 'Renovate Endpoint' + required: true + token: + description: 'Renovate Token' + required: true + github-token: + description: 'GitHub Token' + required: true + args: + description: 'Renovate Args' + required: false + default: '' + save-cache: + description: 'Save cache' + required: false + default: 'false' + +runs: + using: 'composite' + steps: + - uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 + with: + path: | + .tmp/cache/renovate/repository + key: repo-cache-${{ inputs.endpoint }}-${{ github.run_id }} + restore-keys: | + repo-cache-${{ inputs.endpoint }}- + + - run: | + renovate ${{ inputs.args }} + shell: bash + env: + GITHUB_COM_TOKEN: ${{ inputs.github-token }} + LOG_LEVEL: debug + RENOVATE_BASE_DIR: ${{ github.workspace }}/.tmp + RENOVATE_ENDPOINT: ${{ inputs.endpoint }} + RENOVATE_PLATFORM: gitea + RENOVATE_REPOSITORY_CACHE: 'enabled' + RENOVATE_TOKEN: ${{ inputs.token }} + RENOVATE_GIT_AUTHOR: 'Renovate Bot ' + + GIT_AUTHOR_NAME: 'Renovate Bot' + GIT_AUTHOR_EMAIL: 'smeagol@hsn.dev' + GIT_COMMITTER_NAME: 'Renovate Bot' + GIT_COMMITTER_EMAIL: 'smeagol@hsn.dev' + + - name: Save renovate repo cache + if: always() && inputs.save-cache == 'true' + uses: actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 + with: + path: | + .tmp/cache/renovate/repository + key: repo-cache-${{ inputs.endpoint }}-${{ github.run_id }} diff --git a/.forgejo/workflows/renovate.yaml b/.forgejo/workflows/renovate.yaml new file mode 100644 index 0000000..1bf413e --- /dev/null +++ b/.forgejo/workflows/renovate.yaml @@ -0,0 +1,23 @@ +on: + schedule: + - cron: '*/30 * * * *' +jobs: + renovate: + name: Renovate + runs-on: ubuntu-latest + container: + image: ghcr.io/renovatebot/renovate:37.363.8@sha256:d5d20fda77bffb65bb4099389d6cb064e1e06b085bc547e10330bf82317c9693 + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + show-progress: false + + - name: Renovate + uses: ./.forgejo/actions/renovate + with: + endpoint: https://git.hsn.dev/api/v1/ + token: ${{ secrets.RENOVATE_TOKEN }} + github-token: ${{ secrets.GH_TOKEN }} + args: --platform gitea --autodiscover + save-cache: true diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c709af0 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/.tmp \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..60f68e9 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,10 @@ +{ + "yaml.schemas": { + "https://json.schemastore.org/github-workflow.json": [ + ".github/workflows/*", + ".forgejo/workflows/*" + ] + }, + "yaml.schemaStore.enable": true + } + \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..5130473 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# Forgejo Renovate + +A repo to host the renovate bot admin config. diff --git a/renovate.json b/renovate.json new file mode 100644 index 0000000..81fb78c --- /dev/null +++ b/renovate.json @@ -0,0 +1,25 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": ["config:best-practices"], + "semanticCommits": "enabled", + "assignees": ["jahanson"], + "packageRules": [ + { + "description": "use fix scope for renovate updates", + "matchPackageNames": ["ghcr.io/renovatebot/renovate"], + "semanticCommitType": "fix" + }, + { + "description": "Automerge renovate updates", + "matchPackageNames": ["ghcr.io/renovatebot/renovate"], + "matchUpdateTypes": ["minor", "patch", "digest"], + "automerge": true + }, + { + "description": "Update renovate only daily", + "matchDepNames": ["ghcr.io/renovatebot/renovate"], + "extends": ["schedule:daily"] + } + ] + } + \ No newline at end of file