From 15c48d9217269359d959bc2b1acf30dfc9600df7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20H=C3=B8ydahl?= Date: Fri, 17 Feb 2023 01:32:26 +0100 Subject: [PATCH] Adapt for Solr --- .github/renovate.json | 41 ---------- .github/workflows/build.yml | 143 --------------------------------- .github/workflows/renovate.yml | 19 +++++ .gitignore | 4 +- CHANGELOG.md | 4 +- README.md | 13 ++- solr/renovate-config.js | 13 +++ 7 files changed, 47 insertions(+), 190 deletions(-) delete mode 100644 .github/renovate.json delete mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/renovate.yml create mode 100644 solr/renovate-config.js diff --git a/.github/renovate.json b/.github/renovate.json deleted file mode 100644 index ec51463e..00000000 --- a/.github/renovate.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "$schema": "https://docs.renovatebot.com/renovate-schema.json", - "extends": ["github>renovatebot/.github", ":pinDependencies"], - "packageRules": [ - { - "description": "Automerge Renovate updates", - "semanticCommitType": "fix", - "matchPackageNames": ["renovate/renovate"], - "matchUpdateTypes": ["major", "minor", "patch"] - }, - { - "description": "Update references in markdown files weekly", - "matchPaths": ["**/*.md"], - "extends": ["schedule:weekly"], - "automerge": true, - "stabilityDays": 0, - "separateMajorMinor": false, - "commitMessageTopic": "references to {{{depName}}}", - "semanticCommitType": "docs", - "semanticCommitScope": null, - "additionalBranchPrefix": "docs-" - } - ], - "regexManagers": [ - { - "fileMatch": ["^src/docker\\.ts$"], - "matchStrings": [ - "// renovate: datasource=(?[a-z-]+?) depName=(?.+?)(?: versioning=(?[a-z-]+?))?\\s+const\\s+tag\\s+=\\s+'(?.+?)';" - ], - "versioningTemplate": "{{#if versioning}}{{versioning}}{{else}}semver{{/if}}" - }, - { - "fileMatch": ["^README\\.md$"], - "matchStrings": [ - "uses: renovatebot/github-action@(?[^\\s]+)" - ], - "depNameTemplate": "renovatebot/github-action", - "datasourceTemplate": "github-releases" - } - ] -} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index f1e6369f..00000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,143 +0,0 @@ -name: Build - -on: - push: - pull_request: - workflow_dispatch: - -concurrency: - group: ${{ github.workflow }}-${{ github.event.number || github.ref }} - cancel-in-progress: true - -jobs: - commitlint: - runs-on: ubuntu-latest - if: ${{ github.event_name != 'pull_request' || github.repository_owner != github.event.pull_request.head.repo.owner.login }} - - steps: - - name: Checkout - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 - with: - fetch-depth: 0 - - name: Lint commit messages - uses: wagoid/commitlint-github-action@09faa1aae81627890cbffff1d0f7bc0e520a8b01 # v5.3.1 - continue-on-error: true - - lint: - runs-on: ubuntu-latest - if: ${{ github.event_name != 'pull_request' || github.repository_owner != github.event.pull_request.head.repo.owner.login }} - - steps: - - name: Checkout - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 - - name: Setup node - uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 - with: - node-version: '16.x' - cache: 'yarn' - - - name: Install project - run: yarn install --frozen-lockfile - - name: Lint - run: yarn lint - - e2e: - runs-on: ubuntu-latest - if: ${{ github.event_name != 'pull_request' || github.repository_owner != github.event.pull_request.head.repo.owner.login }} - - strategy: - fail-fast: false - matrix: - configurationFile: [example/renovate-config.js, example/renovate.json] - steps: - - name: Checkout - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 - - - name: Install project - run: yarn install --frozen-lockfile - - name: Build - run: yarn build - - - name: Configure renovate token - run: | - if [[ "${RENOVATE_TOKEN}" != "" ]]; then - echo "RENOVATE_TOKEN=${RENOVATE_TOKEN}" >> $GITHUB_ENV - else - echo "RENOVATE_TOKEN=${GITHUB_TOKEN}" >> $GITHUB_ENV - fi - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - RENOVATE_TOKEN: ${{ secrets.RENOVATE_TOKEN }} - - - name: Renovate test - uses: ./ - env: - LOG_LEVEL: debug - with: - configurationFile: ${{ matrix.configurationFile }} - - build: - needs: [lint, commitlint, e2e] - runs-on: ubuntu-latest - steps: - - run: echo 'dummy' - - release: - needs: [build] - runs-on: ubuntu-latest - if: | - ( - startsWith(github.event.commits[0].message, 'fix(deps): update renovate/renovate docker tag ') - || startsWith(github.event.commits[0].message, 'fix(deps): update dependency renovate/renovate ') - || github.event_name == 'workflow_dispatch' - ) - && github.ref == 'refs/heads/main' - steps: - - name: Checkout - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 - with: - fetch-depth: 0 - ref: 'release' - - name: Fetch tags - run: git fetch --tags - - name: Setup Git user - run: | - git config --local user.name "github-actions[bot]" - git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" - - name: Merge main - run: | - git merge -m 'chore(release): merge main (${{ github.sha }})' ${{ github.sha }} - - name: Setup node - uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 - with: - node-version: '16.x' - - name: Install project - run: yarn install --frozen-lockfile --ignore-scripts - - name: Get version - id: release - run: yarn release:version - - name: Release - run: yarn release -- "${{ steps.release.outputs.version }}" - - name: Get changelog section - id: changelog - run: | - changelog="$(git show --unified=0 CHANGELOG.md \ - | tail +12 \ - | sed -e 's/^\+//' \ - | sed -z 's/\n/%0A/g;s/\r/%0D/g')" - echo "::set-output name=changelog::${changelog}" - - name: Publish release - run: git push --follow-tags - - name: Publish GitHub release - uses: actions/create-release@0cb9c9b65d5d1901c1f53e5e66eaf4afd303e70e # renovate: tag=v1.1.4 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: v${{ steps.release.outputs.version }} - release_name: v${{ steps.release.outputs.version }} - body: | - *See the the [changelog]( - https://github.com/${{ github.repository }}/blob/release/CHANGELOG.md - ) for changes in all releases.* - - ${{ steps.changelog.outputs.changelog }} diff --git a/.github/workflows/renovate.yml b/.github/workflows/renovate.yml new file mode 100644 index 00000000..1318b39c --- /dev/null +++ b/.github/workflows/renovate.yml @@ -0,0 +1,19 @@ +name: Renovate +on: + schedule: + # The "*" (#42, asterisk) character has special semantics in YAML, so this + # string has to be quoted. + - cron: '0/5 * * * *' +jobs: + renovate: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3.3.0 + - name: Self-hosted Renovate + uses: renovatebot/github-action@v34.82.0 + with: + configurationFile: solr/renovate-config.js + token: ${{ secrets.RENOVATE_TOKEN }} + env: + RENOVATE_FORK_TOKEN: ${{ secrets.RENOVATE_TOKEN }} diff --git a/.gitignore b/.gitignore index 45d3d17d..86aa721f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +.idea + ##################################################### # macOS # # Source: https://www.gitignore.io # @@ -187,7 +189,7 @@ typings/ # nuxt.js build output .nuxt -# react / gatsby +# react / gatsby public/ # vuepress build output diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c5c0dcc..4dc982e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,5 @@ # Changelog -The changelog is only available on the `releases` branch. Please refer to [CHANGELOG.md](https://github.com/renovatebot/github-action/blob/releases/CHANGELOG.md) there. +## v0.1 + +* First attempt \ No newline at end of file diff --git a/README.md b/README.md index 9779874a..ef7fdcd0 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,11 @@ -# GitHub Action Renovate +# Renovate Github Action for Apache Solr -GitHub Action to run Renovate self-hosted. +GitHub Action to run Renovate self-hosted for the Apache Solr + +This action configuration is forked from https://github.com/renovatebot/github-action. + +See `.github/workflows/renovate.yml` for the workflow and `solr/` folder for custom config. +Below are the original instructions from the forked project. @@ -31,7 +36,7 @@ Options can be passed using the inputs of this action or the corresponding envir ## `configurationFile` -Configuration file to configure Renovate. The supported configurations files can be one of the configuration files listed in the Renovate Docs for [Configuration Options](https://docs.renovatebot.com/configuration-options/) or a JavaScript file that exports a configuration object. For both of these options, an example can be found in the [example](./example) directory. +Configuration file to configure Renovate. The supported configurations files can be one of the configuration files listed in the Renovate Docs for [Configuration Options](https://docs.renovatebot.com/configuration-options/) or a JavaScript file that exports a configuration object. For both of these options, an example can be found in the [example](./solr) directory. The configurations that can be done in this file consists of two parts, as listed below. Refer to the links to the [Renovate Docs](https://docs.renovatebot.com/) for all options. @@ -57,7 +62,7 @@ If you want to use the `github-actions` manager, you must setup a [special token ## Example -This example uses a personal access token and will run every 15 minutes. The personal access token is configured as a GitHub secret named `RENOVATE_TOKEN`. This example uses the [`example/renovate-config.js`](./example/renovate-config.js) file as configuration. +This example uses a personal access token and will run every 15 minutes. The personal access token is configured as a GitHub secret named `RENOVATE_TOKEN`. This example uses the [`example/renovate-config.js`](solr/renovate-config.js) file as configuration. You can also see a live example of this action in my [github-renovate](https://github.com/vidavidorra/github-renovate) repository, which also includes a more [advanced configuration](https://github.com/vidavidorra/github-renovate/blob/master/src/renovate-config.ts) for updating GitHub Action workflows. **Remark** Update the action version to the most current, see [here](https://github.com/renovatebot/github-action/releases/latest) for latest release. diff --git a/solr/renovate-config.js b/solr/renovate-config.js new file mode 100644 index 00000000..4141477c --- /dev/null +++ b/solr/renovate-config.js @@ -0,0 +1,13 @@ +module.exports = { + branchPrefix: 'renovate/', + gitAuthor: 'SolrBot ', + onboarding: false, + requireConfig: false, + platform: 'github', + includeForks: false, + repositories: [ + 'cominvent/renovate-test' + ], + allowedPostUpgradeCommands: ["./gradlew.*"], + dryRun: "full" +};