Skip to content

Latest commit

 

History

History
95 lines (78 loc) · 2.23 KB

README.md

File metadata and controls

95 lines (78 loc) · 2.23 KB

Knope GitHub Action

A GitHub action to install Knope.

Examples

Install Specific Version (recommended)

on: push

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - name: Install Knope
        uses: knope-dev/[email protected]
        with:
          version: 0.10.0
      - name: Use Knope
        run: knope --help

Install Latest Version

You will eventually experience breaking changes if you do this.

on: push

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - name: Install Knope
        uses: knope-dev/[email protected]
      - name: Use Knope
        run: knope --help

If installing the latest version frequently, you may hit GitHub API limits. If that happens, you can pass a GitHub API token (like the built in one) with the github-token input:

on: push

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - name: Install Knope
        uses: knope-dev/[email protected]
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
      - name: Use Knope
        run: knope --help

Updating with Renovate

If pinning to a specific version (recommended), you may want to have Renovate open pull requests when a new version of Knope is available. Here is an example renovate.json which will do exactly that for any GitHub workflows starting with "release" and ending in "yml" (e.g., release-dry-run.yml):

{
  "extends": [
    "config:base",
    ":semanticCommitTypeAll(chore)"
  ],
  "regexManagers": [
    {
      "fileMatch": [
        "release.*\\.yml"
      ],
      "matchStrings": [
        "version:\\s*(?<currentValue>.*)"
      ],
      "depNameTemplate": "knope",
      "datasourceTemplate": "crate",
      "versioningTemplate": "semver"
    }
  ],
  "packageRules": [
    {
      "packagePatterns": [
        "^knope$"
      ],
      "groupName": "knope",
      "rangeStrategy": "pin"
    }
  ]
}

The matchStrings is pretty broad right now because debugging Renovate regex is difficult, so you probably have to narrow it for complex workflows. If you do, please contribute a better match back here!