ci: Restructure reusable workflows

Signed-off-by: Bᴇʀɴᴅ Sᴄʜᴏʀɢᴇʀs <me@bjw-s.dev>
This commit is contained in:
Bᴇʀɴᴅ Sᴄʜᴏʀɢᴇʀs 2022-02-04 10:05:06 +01:00
parent 2a58efa68e
commit 998aa05027
No known key found for this signature in database
GPG Key ID: BC5E2BD907F9A8EC
9 changed files with 94 additions and 138 deletions

View File

@ -1,6 +1,6 @@
---
labels:
- name: kind:incomplete-template
- name: incomplete-template
labeled:
issue:
body: |
@ -9,7 +9,7 @@ labels:
locking: lock
lock_reason: resolved
- name: kind:support
- name: support
labeled:
issue:
body: |
@ -22,7 +22,7 @@ labels:
- [GitHub Discussions](https://github.com/k8s-at-home/organization/discussions)
action: close
- name: kind:incomplete-docs
- name: incomplete-docs
labeled:
pr:
body: |
@ -33,17 +33,3 @@ labels:
- `version` in `Chart.yaml` has been updated per [semver](http://semver.org/)
- The `artifacthub.io/changes` chart annotation contains a summary of the updates for this new version. ([Artifact Hub documentation](https://artifacthub.io/docs/topics/annotations/helm/#supported-annotations))
- [Documentation strings](https://github.com/norwoodj/helm-docs#valuesyaml-metadata) have been added to the keys in `values.yaml`.
Afterwards you can run `./hack/gen-helm-docs.sh stable <chart>` again to update the chart's `README.md` file.
- name: kind:incorrect-title
labeled:
pr:
body: |
:wave: @{{ pull_request.user.login }}, thanks for taking the time to submit this PR. 🙏🏽
We have noticed that the PR title does not adhere to our desired format.
Could you please make sure that it follows the pattern `[<lowercase chart name>] <Update description>`?
Example: `[radarr] Update image version`.
Thanks!

View File

@ -34,23 +34,23 @@
"branchTopic": "{{{parentDir}}}-{{{depNameSanitized}}}-{{{newMajor}}}{{#if isPatch}}.{{{newMinor}}}{{/if}}.x{{#if isLockfileUpdate}}-lockfile{{/if}}",
"updateTypes": ["major"],
"bumpVersion": "major",
"labels": ["dependency/major"],
"labels": ["type/major"],
"packageNames": ["common"],
"groupName": ["internal major dep"]
"groupName": ["common library major"]
},
{
"updateTypes": ["minor"],
"bumpVersion": "minor",
"labels": ["dependency/minor"],
"labels": ["type/minor"],
"packageNames": ["common"],
"groupName": ["internal minor dep"]
"groupName": ["common library minor"]
},
{
"updateTypes": ["patch"],
"bumpVersion": "patch",
"labels": ["dependency/patch"],
"labels": ["type/patch"],
"packageNames": ["common"],
"groupName": ["internal patch dep"]
"groupName": ["common library patch"]
},
//
// Other library deps
@ -60,7 +60,7 @@
"branchTopic": "{{{parentDir}}}-{{{depNameSanitized}}}-{{{newMajor}}}{{#if isPatch}}.{{{newMinor}}}{{/if}}.x{{#if isLockfileUpdate}}-lockfile{{/if}}",
"updateTypes": ["major"],
"bumpVersion": "major",
"labels": ["dependency/major"],
"labels": ["type/major"],
"excludePackageNames": ["common"],
"schedule": [
"every 3 months on the first day of the month"
@ -69,9 +69,9 @@
{
"updateTypes": ["minor"],
"bumpVersion": "minor",
"labels": ["dependency/minor"],
"labels": ["type/minor"],
"excludePackageNames": ["common"],
"groupName": ["external minor dep"],
"groupName": ["external dependency minor"],
"schedule": [
"every 2 months on the first day of the month"
]
@ -79,9 +79,9 @@
{
"updateTypes": ["patch"],
"bumpVersion": "patch",
"labels": ["dependency/patch"],
"labels": ["type/patch"],
"excludePackageNames": ["common"],
"groupName": ["external patch dep"],
"groupName": ["external dependency patch"],
"schedule": [
"every 1 months on the first day of the month"
]

View File

@ -13,9 +13,6 @@ jobs:
name: Label CI status
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Generate Token
uses: tibdex/github-app-token@v1
id: generate-token
@ -23,12 +20,18 @@ jobs:
app_id: ${{ secrets.K8S_AT_HOME_APP_ID }}
private_key: ${{ secrets.K8S_AT_HOME_APP_PRIVATE_KEY }}
- name: Checkout
uses: actions/checkout@v2
with:
token: ${{ steps.generate-token.outputs.token }}
- name: Download workflow artifact
uses: dawidd6/action-download-artifact@v2.11.0
with:
github_token: ${{ steps.generate-token.outputs.token }}
workflow: pr-validate.yaml
name: pr_metadata
path: ./pr_metadata
- name: Read the pr_number file
id: pr_num_reader

View File

@ -1,38 +1,38 @@
# ---
# name: "Metadata: Label Commenter"
---
name: "Metadata: Label Commenter"
# on:
# issues:
# types:
# - labeled
# - unlabeled
# pull_request_target:
# types:
# - labeled
# - unlabeled
on:
issues:
types:
- labeled
- unlabeled
pull_request_target:
types:
- labeled
- unlabeled
# permissions:
# contents: read
# issues: write
# pull-requests: write
permissions:
contents: read
issues: write
pull-requests: write
# jobs:
# comment:
# name: Label commenter
# runs-on: ubuntu-20.04
# steps:
# - name: Generate Token
# uses: tibdex/github-app-token@v1
# id: generate-token
# with:
# app_id: ${{ secrets.K8S_AT_HOME_APP_ID }}
# private_key: ${{ secrets.K8S_AT_HOME_APP_PRIVATE_KEY }}
jobs:
comment:
name: Label commenter
runs-on: ubuntu-20.04
steps:
- name: Generate Token
uses: tibdex/github-app-token@v1
id: generate-token
with:
app_id: ${{ secrets.K8S_AT_HOME_APP_ID }}
private_key: ${{ secrets.K8S_AT_HOME_APP_PRIVATE_KEY }}
# - uses: actions/checkout@v2
# with:
# token: ${{ steps.generate-token.outputs.token }}
# ref: master
- uses: actions/checkout@v2
with:
token: ${{ steps.generate-token.outputs.token }}
ref: master
# - uses: peaceiris/actions-label-commenter@v1
# with:
# github_token: ${{ steps.generate-token.outputs.token }}
- uses: peaceiris/actions-label-commenter@v1
with:
github_token: ${{ steps.generate-token.outputs.token }}

View File

@ -1,72 +0,0 @@
# ---
# name: "Metadata: Label issues and pull requests"
# on:
# issues:
# types:
# - opened
# - edited
# - closed
# - reopened
# pull_request_target:
# types:
# - opened
# - edited
# - closed
# - reopened
# - ready_for_review
# - synchronize
# jobs:
# label:
# name: Label issues and pull requests
# runs-on: ubuntu-20.04
# steps:
# - name: Generate Token
# uses: tibdex/github-app-token@v1
# id: generate-token
# with:
# app_id: ${{ secrets.K8S_AT_HOME_APP_ID }}
# private_key: ${{ secrets.K8S_AT_HOME_APP_PRIVATE_KEY }}
# - uses: Videndum/label-mastermind@2.1.3
# with:
# GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
# configJSON: |
# {
# "releaseMastermind": {
# "labels": {
# "kind:incorrect-title": {
# "name": "kind:incorrect-title",
# "colour": "#ffb700",
# "description": "Incorrect title"
# }
# },
# "runners": [
# {
# "root": ".",
# "versioning": {
# "source": "milestones",
# "type": "other"
# },
# "pr": {
# "labels": {
# "kind:incorrect-title": {
# "requires": 2,
# "conditions": [
# {
# "type": "creatorMatches",
# "pattern": "^(?!renovate).+"
# },
# {
# "type": "titleMatches",
# "pattern": "^(?!\\[[a-z0-9\\-]+\\]\\s.+).+"
# }
# ]
# }
# }
# }
# }
# ]
# }
# }

View File

@ -0,0 +1,39 @@
---
name: "Metadata: Label pull requests"
on:
pull_request_target:
types:
- opened
- edited
- closed
- reopened
- ready_for_review
- synchronize
jobs:
label-size:
name: Label Size
runs-on: ubuntu-latest
steps:
- name: Generate Token
uses: tibdex/github-app-token@v1
id: generate-token
with:
app_id: ${{ secrets.K8S_AT_HOME_APP_ID }}
private_key: ${{ secrets.K8S_AT_HOME_APP_PRIVATE_KEY }}
- name: Label Size
uses: pascalgn/size-label-action@v0.4.3
env:
GITHUB_TOKEN: "${{ steps.generate-token.outputs.token }}"
with:
sizes: >
{
"0": "XS",
"20": "S",
"50": "M",
"200": "L",
"800": "XL",
"2000": "XXL"
}

View File

@ -11,7 +11,7 @@ concurrency:
jobs:
pr-metadata:
uses: k8s-at-home/charts/.github/workflows/pr-get-metadata.yaml@master
uses: k8s-at-home/charts/.github/workflows/pr-metadata.yaml@master
pre-commit-check:
uses: k8s-at-home/charts/.github/workflows/pre-commit-check.yaml@master
@ -21,7 +21,7 @@ jobs:
modifiedFiles: ${{ needs.pr-metadata.outputs.addedOrModifiedFiles }}
charts-readme:
uses: k8s-at-home/charts/.github/workflows/charts-update-readme.yaml@master
uses: k8s-at-home/charts/.github/workflows/charts-readme.yaml@master
needs:
- pr-metadata
- pre-commit-check