Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

ci: only run helm docs on repo-internal PRs #341

Merged
merged 1 commit into from
Jul 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/workflows/helm-docs-skip.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Helm Docs - Skip

on:
push:
branches-ignore:
- renovate/**

jobs:
helm-docs:
runs-on: ubuntu-latest
steps:
- run: echo "Not a renovate PR, nothing to do"
12 changes: 11 additions & 1 deletion .github/workflows/helm-docs.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
name: Helm Docs

on:
pull_request:
push:
branches:
- renovate/**

permissions:
contents: write

jobs:
helm-docs:
runs-on: ubuntu-latest
# Only run this for PRs from the charts repo itself (to auto-update docs for renovate PRs)
# For PRs made by humans, running pre-commit locally is required.
if: ${{ github.event.repository.name == "charts" }}
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3
with:
ref: ${{ github.head_ref }}

- uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4
with:
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: pre-commit

on:
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3

- name: Set up python
id: setup-python
uses: actions/setup-python@bd6b4b6205c4dbad673328db7b31b7fab9e241c0 # v4.6.1
with:
python-version: 3.11.4

- uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4
with:
# renovate: go-version
go-version: 1.20.5

- name: Install helm-docs
# renovate: datasource=github-releases depName=norwoodj/helm-docs
run: go install github.com/norwoodj/helm-docs/cmd/helm-docs@v1.11.0

- name: Cache pre-commit dependencies
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3
with:
path: ~/.cache/pre-commit
key: pre-commit|${{ steps.setup-python.outputs.python-version }}|${{ hashFiles('.pre-commit-config.yaml') }}

- name: Run pre-commit
uses: pre-commit/action@646c83fcd040023954eafda54b4db0192ce70507 # v3.0.0
12 changes: 12 additions & 0 deletions .github/workflows/renovate-config-validator-skip.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Validate renovate config - Skip

on:
pull_request:
paths-ignore:
- renovate.json

jobs:
renovate-validate:
runs-on: ubuntu-latest
steps:
- run: echo "renovate.json not changed, skipping"
3 changes: 1 addition & 2 deletions .github/workflows/renovate-config-validator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ on:
- renovate.json

jobs:
validate:
name: Validate renovate config
renovate-validate:
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down
4 changes: 4 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,12 @@ Before you commit, please run pre-commit. This will also generate the documentat
To set up pre-commit to run automatically on commit, run (example for Ubuntu)

```sh
# Linux
pip3 install pre-commit

# macOS
brew install pre-commit

pre-commit install --hook-type commit-msg --hook-type pre-commit
```

Expand Down
7 changes: 7 additions & 0 deletions renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,13 @@
"matchStrings": [
"# renovate: datasource=(?<datasource>.*?)\\sdepName=(?<depName>.*?)\\s*run: go install github.com/norwoodj/helm-docs/cmd/helm-docs@(?<currentValue>.*)"
]
},
{
"description": "Upgrade python-version version",
"fileMatch": ["(^workflow-templates|\\.github/workflows)/[^/]+\\.ya?ml$"],
"matchStrings": ["python-version:\\s(?<currentValue>.*)"],
"datasourceTemplate": "github-tags",
"depNameTemplate": "python/cpython"
}
]
}
Loading