From 99cc2a09f447e7d390dae666586b7d638f893ba3 Mon Sep 17 00:00:00 2001 From: Kenichi Kamiya Date: Mon, 29 May 2023 04:41:22 +0900 Subject: [PATCH] Add yamlfmt (#930) * `make scaffold PLUGIN=yamlfmt` * Intentionally specify old version of yamlfmt to test * Fullfill the template * `make merge` --- .github/workflows/ci-tool-versions.yml | 1 + default.json | 7 +++++++ examples/.tool-versions | 1 + plugins/yamlfmt.json5 | 15 +++++++++++++++ renovate.json | 2 +- test/examples.ts | 5 +++++ 6 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 plugins/yamlfmt.json5 diff --git a/.github/workflows/ci-tool-versions.yml b/.github/workflows/ci-tool-versions.yml index 8f3fe42e..37875ff5 100644 --- a/.github/workflows/ci-tool-versions.yml +++ b/.github/workflows/ci-tool-versions.yml @@ -6,6 +6,7 @@ on: jobs: installable: + if: ${{ github.actor == 'renovate[bot]' }} runs-on: ubuntu-latest timeout-minutes: 15 steps: diff --git a/default.json b/default.json index 633b2f7c..5ac791f1 100644 --- a/default.json +++ b/default.json @@ -250,6 +250,13 @@ "datasourceTemplate": "github-releases", "extractVersionTemplate": "^v(?\\S+)" }, + { + "fileMatch": ["\\.tool-versions$"], + "matchStrings": ["(^|\\n)yamlfmt (?\\S+)"], + "depNameTemplate": "google/yamlfmt", + "datasourceTemplate": "github-releases", + "extractVersionTemplate": "^v(?\\S+)" + }, { "fileMatch": ["\\.tool-versions$"], "matchStrings": ["(^|\\n)zig (?\\S+)"], diff --git a/examples/.tool-versions b/examples/.tool-versions index 58f677df..34bc77ce 100644 --- a/examples/.tool-versions +++ b/examples/.tool-versions @@ -34,4 +34,5 @@ shellcheck 0.9.0 shfmt 3.6.0 terraform 1.4.6 trivy 0.41.0 +yamlfmt 0.4.0 zig 0.10.0 diff --git a/plugins/yamlfmt.json5 b/plugins/yamlfmt.json5 new file mode 100644 index 00000000..3f733386 --- /dev/null +++ b/plugins/yamlfmt.json5 @@ -0,0 +1,15 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "description": "Bump yamlfmt in .tool-versions", + "regexManagers": [ + { + "fileMatch": ["\\.tool-versions$"], + "matchStrings": ["(^|\\n)yamlfmt (?\\S+)"], + // Plugin Fetcher Permalink: https://github.com/kachick/asdf-yamlfmt/blob/1f5ae4412dd879fcd4d9eeaae9ccd59c0f22721e/lib/utils.bash#L60 + // DataSource URL: https://github.com/google/yamlfmt/releases + "depNameTemplate": "google/yamlfmt", + "datasourceTemplate": "github-releases", + "extractVersionTemplate": "^v(?\\S+)" + } + ] +} diff --git a/renovate.json b/renovate.json index 6231f9cc..7a027266 100644 --- a/renovate.json +++ b/renovate.json @@ -27,7 +27,7 @@ "matchPackagePrefixes": ["dprint"] } ], - "labels": ["renovate", "dependencies", "ignore-this-label-just-for-trigger-renovate-34d839"], + "labels": ["renovate", "dependencies", "ignore-this-label-just-for-trigger-renovate-b5d5af"], "ignorePaths": [ "**/node_modules/**", "**/bower_components/**", diff --git a/test/examples.ts b/test/examples.ts index a3bd8e1f..833fcafc 100644 --- a/test/examples.ts +++ b/test/examples.ts @@ -131,4 +131,9 @@ export const examples = [ source: 'v0.31.3', extracted: '0.31.3', }, + { + plugin: 'yamlfmt', + source: 'v0.9.0', + extracted: '0.9.0', + }, ] as const satisfies Readonly[]>;