mirror of
https://github.com/k8s-at-home/charts.git
synced 2025-02-03 07:49:03 +00:00
ci: Update workflow formatting, token action
Signed-off-by: Bᴇʀɴᴅ Sᴄʜᴏʀɢᴇʀs <me@bjw-s.dev>
This commit is contained in:
parent
42dbe4ee4a
commit
a3582f3c83
118
.github/workflows/charts-release.yaml
vendored
118
.github/workflows/charts-release.yaml
vendored
@ -6,82 +6,82 @@ on:
|
|||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
paths:
|
paths:
|
||||||
- 'charts/**'
|
- "charts/**"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
release:
|
release:
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
steps:
|
steps:
|
||||||
- name: Get k8s-at-home token
|
- name: Generate Token
|
||||||
id: get-app-token
|
uses: tibdex/github-app-token@v1
|
||||||
uses: getsentry/action-github-app-token@v1
|
id: generate-token
|
||||||
with:
|
with:
|
||||||
app_id: ${{ secrets.K8S_AT_HOME_APP_ID }}
|
app_id: ${{ secrets.K8S_AT_HOME_APP_ID }}
|
||||||
private_key: ${{ secrets.K8S_AT_HOME_APP_PRIVATE_KEY }}
|
private_key: ${{ secrets.K8S_AT_HOME_APP_PRIVATE_KEY }}
|
||||||
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
token: ${{ steps.get-app-token.outputs.token }}
|
token: ${{ steps.generate-token.outputs.token }}
|
||||||
ref: master
|
ref: master
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Configure Git
|
- name: Configure Git
|
||||||
run: |
|
run: |
|
||||||
git config user.name "k8s-at-home[bot]"
|
git config user.name "k8s-at-home[bot]"
|
||||||
git config user.email "k8s-at-home[bot]@users.noreply.github.com"
|
git config user.email "k8s-at-home[bot]@users.noreply.github.com"
|
||||||
|
|
||||||
- name: Install Helm
|
- name: Install Helm
|
||||||
uses: azure/setup-helm@v1
|
uses: azure/setup-helm@v1
|
||||||
with:
|
with:
|
||||||
version: v3.6.3
|
version: v3.6.3
|
||||||
|
|
||||||
- name: Run chart-releaser
|
- name: Run chart-releaser
|
||||||
uses: helm/chart-releaser-action@v1.2.1
|
uses: helm/chart-releaser-action@v1.2.1
|
||||||
with:
|
with:
|
||||||
charts_dir: charts/*
|
charts_dir: charts/*
|
||||||
charts_repo_url: https://k8s-at-home.com/charts/
|
charts_repo_url: https://k8s-at-home.com/charts/
|
||||||
env:
|
env:
|
||||||
CR_TOKEN: "${{ steps.get-app-token.outputs.token }}"
|
CR_TOKEN: "${{ steps.generate-token.outputs.token }}"
|
||||||
CR_SKIP_EXISTING: "true"
|
CR_SKIP_EXISTING: "true"
|
||||||
|
|
||||||
generate-summary:
|
generate-summary:
|
||||||
name: Auto-generate charts summary
|
name: Auto-generate charts summary
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
needs:
|
needs:
|
||||||
- release
|
- release
|
||||||
steps:
|
steps:
|
||||||
- name: Get k8s-at-home token
|
- name: Generate Token
|
||||||
id: get-app-token
|
uses: tibdex/github-app-token@v1
|
||||||
uses: getsentry/action-github-app-token@v1
|
id: generate-token
|
||||||
with:
|
with:
|
||||||
app_id: ${{ secrets.K8S_AT_HOME_APP_ID }}
|
app_id: ${{ secrets.K8S_AT_HOME_APP_ID }}
|
||||||
private_key: ${{ secrets.K8S_AT_HOME_APP_PRIVATE_KEY }}
|
private_key: ${{ secrets.K8S_AT_HOME_APP_PRIVATE_KEY }}
|
||||||
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
token: ${{ steps.get-app-token.outputs.token }}
|
token: ${{ steps.generate-token.outputs.token }}
|
||||||
ref: master
|
ref: master
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Install yq
|
- name: Install yq
|
||||||
uses: chrisdickinson/setup-yq@latest
|
uses: chrisdickinson/setup-yq@latest
|
||||||
with:
|
with:
|
||||||
yq-version: v4.9.3
|
yq-version: v4.9.3
|
||||||
|
|
||||||
- name: Run script
|
- name: Run script
|
||||||
run: |
|
run: |
|
||||||
./hack/gen-chart-summary.sh
|
./hack/gen-chart-summary.sh
|
||||||
|
|
||||||
- name: Create Commit
|
- name: Create Commit
|
||||||
uses: stefanzweifel/git-auto-commit-action@v4
|
uses: stefanzweifel/git-auto-commit-action@v4
|
||||||
with:
|
with:
|
||||||
push_options: --force
|
push_options: --force
|
||||||
commit_message: Auto-generate chart summary [no ci]
|
commit_message: Auto-generate chart summary [no ci]
|
||||||
commit_user_name: k8s-at-home[bot]
|
commit_user_name: k8s-at-home[bot]
|
||||||
commit_user_email: k8s-at-home[bot]@users.noreply.github.com
|
commit_user_email: k8s-at-home[bot]@users.noreply.github.com
|
||||||
commit_author: k8s-at-home[bot] <k8s-at-home[bot]@users.noreply.github.com>
|
commit_author: k8s-at-home[bot] <k8s-at-home[bot]@users.noreply.github.com>
|
||||||
file_pattern: charts/README.md
|
file_pattern: charts/README.md
|
||||||
|
220
.github/workflows/charts-validate.yaml
vendored
220
.github/workflows/charts-validate.yaml
vendored
@ -66,9 +66,9 @@ jobs:
|
|||||||
if: |
|
if: |
|
||||||
needs.pr-metadata.outputs.isFork == 'false'
|
needs.pr-metadata.outputs.isFork == 'false'
|
||||||
steps:
|
steps:
|
||||||
- name: Get app-token
|
- name: Generate Token
|
||||||
uses: getsentry/action-github-app-token@v1
|
uses: tibdex/github-app-token@v1
|
||||||
id: get-app-token
|
id: generate-token
|
||||||
with:
|
with:
|
||||||
app_id: ${{ secrets.K8S_AT_HOME_APP_ID }}
|
app_id: ${{ secrets.K8S_AT_HOME_APP_ID }}
|
||||||
private_key: ${{ secrets.K8S_AT_HOME_APP_PRIVATE_KEY }}
|
private_key: ${{ secrets.K8S_AT_HOME_APP_PRIVATE_KEY }}
|
||||||
@ -77,7 +77,7 @@ jobs:
|
|||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
token: ${{ steps.get-app-token.outputs.token }}
|
token: ${{ steps.generate-token.outputs.token }}
|
||||||
|
|
||||||
- uses: yokawasa/action-setup-kube-tools@v0.8.0
|
- uses: yokawasa/action-setup-kube-tools@v0.8.0
|
||||||
if: |
|
if: |
|
||||||
@ -153,25 +153,25 @@ jobs:
|
|||||||
always() &&
|
always() &&
|
||||||
needs.generate-readme.outputs.commitHash == ''
|
needs.generate-readme.outputs.commitHash == ''
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Set up chart-testing
|
- name: Set up chart-testing
|
||||||
uses: helm/chart-testing-action@v2.1.0
|
uses: helm/chart-testing-action@v2.1.0
|
||||||
|
|
||||||
- name: Run chart-testing (list-changed)
|
- name: Run chart-testing (list-changed)
|
||||||
id: list-changed
|
id: list-changed
|
||||||
run: |
|
run: |
|
||||||
EXCLUDED=$(yq eval -o=json '.excluded-charts // []' .github/ct-lint.yaml)
|
EXCLUDED=$(yq eval -o=json '.excluded-charts // []' .github/ct-lint.yaml)
|
||||||
CHARTS=$(ct list-changed --config .github/ct-lint.yaml)
|
CHARTS=$(ct list-changed --config .github/ct-lint.yaml)
|
||||||
CHARTS_JSON=$(echo "${CHARTS}" | jq -R -s -c 'split("\n")[:-1]')
|
CHARTS_JSON=$(echo "${CHARTS}" | jq -R -s -c 'split("\n")[:-1]')
|
||||||
OUTPUT_JSON=$(echo "{\"excluded\": ${EXCLUDED}, \"all\": ${CHARTS_JSON}}" | jq -c '.all-.excluded')
|
OUTPUT_JSON=$(echo "{\"excluded\": ${EXCLUDED}, \"all\": ${CHARTS_JSON}}" | jq -c '.all-.excluded')
|
||||||
echo ::set-output name=charts::${OUTPUT_JSON}
|
echo ::set-output name=charts::${OUTPUT_JSON}
|
||||||
if [[ $(echo ${OUTPUT_JSON} | jq -c '. | length') -gt 0 ]]; then
|
if [[ $(echo ${OUTPUT_JSON} | jq -c '. | length') -gt 0 ]]; then
|
||||||
echo "::set-output name=detected::true"
|
echo "::set-output name=detected::true"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
changes-install:
|
changes-install:
|
||||||
name: Detect changes for install
|
name: Detect changes for install
|
||||||
@ -189,99 +189,97 @@ jobs:
|
|||||||
always() &&
|
always() &&
|
||||||
needs.generate-readme.outputs.commitHash == ''
|
needs.generate-readme.outputs.commitHash == ''
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Set up chart-testing
|
- name: Set up chart-testing
|
||||||
uses: helm/chart-testing-action@v2.1.0
|
uses: helm/chart-testing-action@v2.1.0
|
||||||
|
|
||||||
- name: Run chart-testing (list-changed)
|
- name: Run chart-testing (list-changed)
|
||||||
id: list-changed
|
id: list-changed
|
||||||
run: |
|
run: |
|
||||||
EXCLUDED=$(yq eval -o=json '.excluded-charts // []' .github/ct-install.yaml)
|
EXCLUDED=$(yq eval -o=json '.excluded-charts // []' .github/ct-install.yaml)
|
||||||
CHARTS=$(ct list-changed --config .github/ct-install.yaml)
|
CHARTS=$(ct list-changed --config .github/ct-install.yaml)
|
||||||
CHARTS_JSON=$(echo "${CHARTS}" | jq -R -s -c 'split("\n")[:-1]')
|
CHARTS_JSON=$(echo "${CHARTS}" | jq -R -s -c 'split("\n")[:-1]')
|
||||||
OUTPUT_JSON=$(echo "{\"excluded\": ${EXCLUDED}, \"all\": ${CHARTS_JSON}}" | jq -c '.all-.excluded')
|
OUTPUT_JSON=$(echo "{\"excluded\": ${EXCLUDED}, \"all\": ${CHARTS_JSON}}" | jq -c '.all-.excluded')
|
||||||
echo ::set-output name=charts::${OUTPUT_JSON}
|
echo ::set-output name=charts::${OUTPUT_JSON}
|
||||||
if [[ $(echo ${OUTPUT_JSON} | jq -c '. | length') -gt 0 ]]; then
|
if [[ $(echo ${OUTPUT_JSON} | jq -c '. | length') -gt 0 ]]; then
|
||||||
echo "::set-output name=detected::true"
|
echo "::set-output name=detected::true"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
lint:
|
lint:
|
||||||
needs:
|
needs:
|
||||||
- changes-lint
|
- changes-lint
|
||||||
if:
|
if: always() &&
|
||||||
always() &&
|
|
||||||
needs.changes-lint.outputs.detected == 'true'
|
needs.changes-lint.outputs.detected == 'true'
|
||||||
name: Lint successful
|
name: Lint successful
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Install Helm
|
- name: Install Helm
|
||||||
uses: azure/setup-helm@v1
|
uses: azure/setup-helm@v1
|
||||||
with:
|
with:
|
||||||
version: v3.6.3
|
version: v3.6.3
|
||||||
|
|
||||||
- uses: actions/setup-python@v2
|
- uses: actions/setup-python@v2
|
||||||
with:
|
with:
|
||||||
python-version: 3.7
|
python-version: 3.7
|
||||||
|
|
||||||
- name: Set up chart-testing
|
- name: Set up chart-testing
|
||||||
uses: helm/chart-testing-action@v2.1.0
|
uses: helm/chart-testing-action@v2.1.0
|
||||||
|
|
||||||
- name: Run chart-testing (lint)
|
- name: Run chart-testing (lint)
|
||||||
id: lint
|
id: lint
|
||||||
run: ct lint --config .github/ct-lint.yaml
|
run: ct lint --config .github/ct-lint.yaml
|
||||||
|
|
||||||
unittest:
|
unittest:
|
||||||
needs:
|
needs:
|
||||||
- lint
|
- lint
|
||||||
if: |
|
if: |
|
||||||
always() &&
|
always() &&
|
||||||
needs.lint.result == 'success'
|
needs.lint.result == 'success'
|
||||||
name: Run unit tests
|
name: Run unit tests
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Install Dev tools
|
- name: Install Dev tools
|
||||||
run: sudo apt-get update && sudo apt-get install -y jq libjq-dev
|
run: sudo apt-get update && sudo apt-get install -y jq libjq-dev
|
||||||
|
|
||||||
- name: Install Helm
|
- name: Install Helm
|
||||||
uses: azure/setup-helm@v1
|
uses: azure/setup-helm@v1
|
||||||
with:
|
with:
|
||||||
version: v3.6.3
|
version: v3.6.3
|
||||||
|
|
||||||
- name: Install Ruby
|
- name: Install Ruby
|
||||||
uses: ruby/setup-ruby@v1
|
uses: ruby/setup-ruby@v1
|
||||||
with:
|
with:
|
||||||
ruby-version: 2.7
|
ruby-version: 2.7
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
env:
|
env:
|
||||||
RUBYJQ_USE_SYSTEM_LIBRARIES: 1
|
RUBYJQ_USE_SYSTEM_LIBRARIES: 1
|
||||||
run: |
|
run: |
|
||||||
bundle install
|
bundle install
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: |
|
run: |
|
||||||
bundle exec m -r ./test/
|
bundle exec m -r ./test/
|
||||||
|
|
||||||
install:
|
install:
|
||||||
needs:
|
needs:
|
||||||
- changes-install
|
- changes-install
|
||||||
- lint
|
- lint
|
||||||
if:
|
if: always() &&
|
||||||
always() &&
|
|
||||||
needs.lint.result == 'success' &&
|
needs.lint.result == 'success' &&
|
||||||
needs.changes-install.outputs.detected == 'true'
|
needs.changes-install.outputs.detected == 'true'
|
||||||
name: Install charts
|
name: Install charts
|
||||||
@ -291,46 +289,46 @@ jobs:
|
|||||||
max-parallel: 15
|
max-parallel: 15
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Install Helm
|
- name: Install Helm
|
||||||
uses: azure/setup-helm@v1
|
uses: azure/setup-helm@v1
|
||||||
with:
|
with:
|
||||||
version: v3.6.3
|
version: v3.6.3
|
||||||
|
|
||||||
- uses: actions/setup-python@v2
|
- uses: actions/setup-python@v2
|
||||||
with:
|
with:
|
||||||
python-version: 3.7
|
python-version: 3.7
|
||||||
|
|
||||||
- name: Set up chart-testing
|
- name: Set up chart-testing
|
||||||
uses: helm/chart-testing-action@v2.1.0
|
uses: helm/chart-testing-action@v2.1.0
|
||||||
|
|
||||||
- name: Create k3d cluster
|
- name: Create k3d cluster
|
||||||
uses: nolar/setup-k3d-k3s@v1
|
uses: nolar/setup-k3d-k3s@v1
|
||||||
with:
|
with:
|
||||||
version: v1.19
|
version: v1.19
|
||||||
|
|
||||||
- name: Remove node taints
|
- name: Remove node taints
|
||||||
run: |
|
run: |
|
||||||
kubectl taint --all=true nodes node.cloudprovider.kubernetes.io/uninitialized- || true
|
kubectl taint --all=true nodes node.cloudprovider.kubernetes.io/uninitialized- || true
|
||||||
|
|
||||||
- name: Run chart-testing (install)
|
- name: Run chart-testing (install)
|
||||||
run: ct install --config .github/ct-install.yaml --charts ${{ matrix.chart }}
|
run: ct install --config .github/ct-install.yaml --charts ${{ matrix.chart }}
|
||||||
|
|
||||||
# Summarize matrix https://github.community/t/status-check-for-a-matrix-jobs/127354/7
|
# Summarize matrix https://github.community/t/status-check-for-a-matrix-jobs/127354/7
|
||||||
install_success:
|
install_success:
|
||||||
needs:
|
needs:
|
||||||
- changes-install
|
- changes-install
|
||||||
- install
|
- install
|
||||||
if: |
|
if: |
|
||||||
always() &&
|
always() &&
|
||||||
needs.install.result != 'skipped'
|
needs.install.result != 'skipped'
|
||||||
name: Install successful
|
name: Install successful
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
steps:
|
steps:
|
||||||
- name: Check install matrix status
|
- name: Check install matrix status
|
||||||
if: ${{ needs.changes-install.outputs.detected == 'true' && needs.install.result != 'success' }}
|
if: ${{ needs.changes-install.outputs.detected == 'true' && needs.install.result != 'success' }}
|
||||||
run: exit 1
|
run: exit 1
|
||||||
|
27
.github/workflows/metadata-label-commenter.yaml
vendored
27
.github/workflows/metadata-label-commenter.yaml
vendored
@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
name: 'Metadata: Label Commenter'
|
name: "Metadata: Label Commenter"
|
||||||
|
|
||||||
on:
|
on:
|
||||||
issues:
|
issues:
|
||||||
@ -21,17 +21,18 @@ jobs:
|
|||||||
name: Label commenter
|
name: Label commenter
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
steps:
|
steps:
|
||||||
- uses: getsentry/action-github-app-token@v1
|
- name: Generate Token
|
||||||
id: get-app-token
|
uses: tibdex/github-app-token@v1
|
||||||
with:
|
id: generate-token
|
||||||
app_id: ${{ secrets.K8S_AT_HOME_APP_ID }}
|
with:
|
||||||
private_key: ${{ secrets.K8S_AT_HOME_APP_PRIVATE_KEY }}
|
app_id: ${{ secrets.K8S_AT_HOME_APP_ID }}
|
||||||
|
private_key: ${{ secrets.K8S_AT_HOME_APP_PRIVATE_KEY }}
|
||||||
|
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
token: ${{ steps.get-app-token.outputs.token }}
|
token: ${{ steps.generate-token.outputs.token }}
|
||||||
ref: master
|
ref: master
|
||||||
|
|
||||||
- uses: peaceiris/actions-label-commenter@v1
|
- uses: peaceiris/actions-label-commenter@v1
|
||||||
with:
|
with:
|
||||||
github_token: ${{ steps.get-app-token.outputs.token }}
|
github_token: ${{ steps.generate-token.outputs.token }}
|
||||||
|
85
.github/workflows/metadata-label-issues-prs.yaml
vendored
85
.github/workflows/metadata-label-issues-prs.yaml
vendored
@ -22,50 +22,51 @@ jobs:
|
|||||||
name: Label issues and pull requests
|
name: Label issues and pull requests
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
steps:
|
steps:
|
||||||
- uses: getsentry/action-github-app-token@v1
|
- name: Generate Token
|
||||||
id: get-app-token
|
uses: tibdex/github-app-token@v1
|
||||||
with:
|
id: generate-token
|
||||||
app_id: ${{ secrets.K8S_AT_HOME_APP_ID }}
|
with:
|
||||||
private_key: ${{ secrets.K8S_AT_HOME_APP_PRIVATE_KEY }}
|
app_id: ${{ secrets.K8S_AT_HOME_APP_ID }}
|
||||||
|
private_key: ${{ secrets.K8S_AT_HOME_APP_PRIVATE_KEY }}
|
||||||
|
|
||||||
- uses: Videndum/label-mastermind@2.1.3
|
- uses: Videndum/label-mastermind@2.1.3
|
||||||
with:
|
with:
|
||||||
GITHUB_TOKEN: ${{ steps.get-app-token.outputs.token }}
|
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
|
||||||
configJSON: |
|
configJSON: |
|
||||||
{
|
{
|
||||||
"releaseMastermind": {
|
"releaseMastermind": {
|
||||||
"labels": {
|
"labels": {
|
||||||
"kind:incorrect-title": {
|
"kind:incorrect-title": {
|
||||||
"name": "kind:incorrect-title",
|
"name": "kind:incorrect-title",
|
||||||
"colour": "#ffb700",
|
"colour": "#ffb700",
|
||||||
"description": "Incorrect title"
|
"description": "Incorrect title"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"runners": [
|
"runners": [
|
||||||
{
|
{
|
||||||
"root": ".",
|
"root": ".",
|
||||||
"versioning": {
|
"versioning": {
|
||||||
"source": "milestones",
|
"source": "milestones",
|
||||||
"type": "other"
|
"type": "other"
|
||||||
},
|
},
|
||||||
"pr": {
|
"pr": {
|
||||||
"labels": {
|
"labels": {
|
||||||
"kind:incorrect-title": {
|
"kind:incorrect-title": {
|
||||||
"requires": 2,
|
"requires": 2,
|
||||||
"conditions": [
|
"conditions": [
|
||||||
{
|
{
|
||||||
"type": "creatorMatches",
|
"type": "creatorMatches",
|
||||||
"pattern": "^(?!renovate).+"
|
"pattern": "^(?!renovate).+"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "titleMatches",
|
"type": "titleMatches",
|
||||||
"pattern": "^(?!\\[[a-z0-9\\-]+\\]\\s.+).+"
|
"pattern": "^(?!\\[[a-z0-9\\-]+\\]\\s.+).+"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
]
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
188
.github/workflows/metadata-label-pr-ci-status.yaml
vendored
188
.github/workflows/metadata-label-pr-ci-status.yaml
vendored
@ -4,10 +4,10 @@ name: "Metadata: Label pull requests CI status"
|
|||||||
on:
|
on:
|
||||||
workflow_run:
|
workflow_run:
|
||||||
workflows:
|
workflows:
|
||||||
- "Pre-commit consistency check"
|
- "Pre-commit consistency check"
|
||||||
- "Charts: Validate"
|
- "Charts: Validate"
|
||||||
types:
|
types:
|
||||||
- completed
|
- completed
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
label-precommit:
|
label-precommit:
|
||||||
@ -15,112 +15,114 @@ jobs:
|
|||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
if: "${{ github.event.workflow.name == 'Pre-commit consistency check' }}"
|
if: "${{ github.event.workflow.name == 'Pre-commit consistency check' }}"
|
||||||
steps:
|
steps:
|
||||||
- uses: getsentry/action-github-app-token@v1
|
- name: Generate Token
|
||||||
id: get-app-token
|
uses: tibdex/github-app-token@v1
|
||||||
with:
|
id: generate-token
|
||||||
app_id: ${{ secrets.K8S_AT_HOME_APP_ID }}
|
with:
|
||||||
private_key: ${{ secrets.K8S_AT_HOME_APP_PRIVATE_KEY }}
|
app_id: ${{ secrets.K8S_AT_HOME_APP_ID }}
|
||||||
|
private_key: ${{ secrets.K8S_AT_HOME_APP_PRIVATE_KEY }}
|
||||||
|
|
||||||
- name: "Get information about the origin 'CI' run"
|
- name: "Get information about the origin 'CI' run"
|
||||||
uses: potiuk/get-workflow-origin@v1_3
|
uses: potiuk/get-workflow-origin@v1_3
|
||||||
id: source-run-info
|
id: source-run-info
|
||||||
with:
|
with:
|
||||||
token: ${{ steps.get-app-token.outputs.token }}
|
token: ${{ steps.generate-token.outputs.token }}
|
||||||
sourceRunId: ${{ github.event.workflow_run.id }}
|
sourceRunId: ${{ github.event.workflow_run.id }}
|
||||||
|
|
||||||
- name: Label precommit success
|
- name: Label precommit success
|
||||||
uses: andymckay/labeler@1.0.4
|
uses: andymckay/labeler@1.0.4
|
||||||
if: ${{ github.event.workflow_run.conclusion == 'success' }}
|
if: ${{ github.event.workflow_run.conclusion == 'success' }}
|
||||||
with:
|
with:
|
||||||
repo-token: ${{ steps.get-app-token.outputs.token }}
|
repo-token: ${{ steps.generate-token.outputs.token }}
|
||||||
issue-number: ${{ steps.source-run-info.outputs.pullRequestNumber }}
|
issue-number: ${{ steps.source-run-info.outputs.pullRequestNumber }}
|
||||||
add-labels: "precommit:ok"
|
add-labels: "precommit:ok"
|
||||||
remove-labels: "precommit:failed"
|
remove-labels: "precommit:failed"
|
||||||
|
|
||||||
- name: Label precommit failure
|
- name: Label precommit failure
|
||||||
uses: andymckay/labeler@1.0.4
|
uses: andymckay/labeler@1.0.4
|
||||||
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
|
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
|
||||||
with:
|
with:
|
||||||
repo-token: ${{ steps.get-app-token.outputs.token }}
|
repo-token: ${{ steps.generate-token.outputs.token }}
|
||||||
issue-number: ${{ steps.source-run-info.outputs.pullRequestNumber }}
|
issue-number: ${{ steps.source-run-info.outputs.pullRequestNumber }}
|
||||||
add-labels: "precommit:failed"
|
add-labels: "precommit:failed"
|
||||||
remove-labels: "precommit:ok"
|
remove-labels: "precommit:ok"
|
||||||
|
|
||||||
label-lint-install:
|
label-lint-install:
|
||||||
name: Label lint and install status
|
name: Label lint and install status
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
if: "${{ github.event.workflow.name == 'Charts: Validate' }}"
|
if: "${{ github.event.workflow.name == 'Charts: Validate' }}"
|
||||||
steps:
|
steps:
|
||||||
- uses: getsentry/action-github-app-token@v1
|
- name: Generate Token
|
||||||
id: get-app-token
|
uses: tibdex/github-app-token@v1
|
||||||
with:
|
id: generate-token
|
||||||
app_id: ${{ secrets.K8S_AT_HOME_APP_ID }}
|
with:
|
||||||
private_key: ${{ secrets.K8S_AT_HOME_APP_PRIVATE_KEY }}
|
app_id: ${{ secrets.K8S_AT_HOME_APP_ID }}
|
||||||
|
private_key: ${{ secrets.K8S_AT_HOME_APP_PRIVATE_KEY }}
|
||||||
|
|
||||||
- name: "Get information about the origin 'CI' run"
|
- name: "Get information about the origin 'CI' run"
|
||||||
uses: potiuk/get-workflow-origin@v1_3
|
uses: potiuk/get-workflow-origin@v1_3
|
||||||
id: source-run-info
|
id: source-run-info
|
||||||
with:
|
with:
|
||||||
token: ${{ steps.get-app-token.outputs.token }}
|
token: ${{ steps.generate-token.outputs.token }}
|
||||||
sourceRunId: ${{ github.event.workflow_run.id }}
|
sourceRunId: ${{ github.event.workflow_run.id }}
|
||||||
|
|
||||||
- name: "Get workflow job status"
|
- name: "Get workflow job status"
|
||||||
uses: actions/github-script@v5
|
uses: actions/github-script@v5
|
||||||
id: get-workflow-jobs
|
id: get-workflow-jobs
|
||||||
with:
|
with:
|
||||||
github-token: ${{ steps.get-app-token.outputs.token }}
|
github-token: ${{ steps.generate-token.outputs.token }}
|
||||||
script: |
|
script: |
|
||||||
let result = new Object
|
let result = new Object
|
||||||
|
|
||||||
const wfJobs = await github.rest.actions.listJobsForWorkflowRun({
|
const wfJobs = await github.rest.actions.listJobsForWorkflowRun({
|
||||||
owner: context.repo.owner,
|
owner: context.repo.owner,
|
||||||
repo: context.repo.repo,
|
repo: context.repo.repo,
|
||||||
run_id: context.payload.workflow_run.id,
|
run_id: context.payload.workflow_run.id,
|
||||||
})
|
})
|
||||||
|
|
||||||
for (const job of wfJobs.data.jobs) {
|
for (const job of wfJobs.data.jobs) {
|
||||||
if (job.name === 'Lint successful') {
|
if (job.name === 'Lint successful') {
|
||||||
result['lint'] = job.conclusion
|
result['lint'] = job.conclusion
|
||||||
} else if (job.name === 'Install successful') {
|
} else if (job.name === 'Install successful') {
|
||||||
result['install'] = job.conclusion
|
result['install'] = job.conclusion
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
console.log(result)
|
console.log(result)
|
||||||
return result
|
return result
|
||||||
|
|
||||||
- name: Label lint success
|
- name: Label lint success
|
||||||
uses: andymckay/labeler@1.0.4
|
uses: andymckay/labeler@1.0.4
|
||||||
if: ${{ fromJSON(steps.get-workflow-jobs.outputs.result).lint == 'success' }}
|
if: ${{ fromJSON(steps.get-workflow-jobs.outputs.result).lint == 'success' }}
|
||||||
with:
|
with:
|
||||||
repo-token: ${{ steps.get-app-token.outputs.token }}
|
repo-token: ${{ steps.generate-token.outputs.token }}
|
||||||
issue-number: ${{ steps.source-run-info.outputs.pullRequestNumber }}
|
issue-number: ${{ steps.source-run-info.outputs.pullRequestNumber }}
|
||||||
add-labels: "lint:ok"
|
add-labels: "lint:ok"
|
||||||
remove-labels: "lint:failed"
|
remove-labels: "lint:failed"
|
||||||
|
|
||||||
- name: Label lint failure
|
- name: Label lint failure
|
||||||
uses: andymckay/labeler@1.0.4
|
uses: andymckay/labeler@1.0.4
|
||||||
if: ${{ fromJSON(steps.get-workflow-jobs.outputs.result).lint == 'failure' }}
|
if: ${{ fromJSON(steps.get-workflow-jobs.outputs.result).lint == 'failure' }}
|
||||||
with:
|
with:
|
||||||
repo-token: ${{ steps.get-app-token.outputs.token }}
|
repo-token: ${{ steps.generate-token.outputs.token }}
|
||||||
issue-number: ${{ steps.source-run-info.outputs.pullRequestNumber }}
|
issue-number: ${{ steps.source-run-info.outputs.pullRequestNumber }}
|
||||||
add-labels: "lint:failed"
|
add-labels: "lint:failed"
|
||||||
remove-labels: "lint:ok"
|
remove-labels: "lint:ok"
|
||||||
|
|
||||||
- name: Label install success
|
- name: Label install success
|
||||||
uses: andymckay/labeler@1.0.4
|
uses: andymckay/labeler@1.0.4
|
||||||
if: ${{ fromJSON(steps.get-workflow-jobs.outputs.result).install == 'success' }}
|
if: ${{ fromJSON(steps.get-workflow-jobs.outputs.result).install == 'success' }}
|
||||||
with:
|
with:
|
||||||
repo-token: ${{ steps.get-app-token.outputs.token }}
|
repo-token: ${{ steps.generate-token.outputs.token }}
|
||||||
issue-number: ${{ steps.source-run-info.outputs.pullRequestNumber }}
|
issue-number: ${{ steps.source-run-info.outputs.pullRequestNumber }}
|
||||||
add-labels: "install:ok"
|
add-labels: "install:ok"
|
||||||
remove-labels: "install:failed"
|
remove-labels: "install:failed"
|
||||||
|
|
||||||
- name: Label install failure
|
- name: Label install failure
|
||||||
uses: andymckay/labeler@1.0.4
|
uses: andymckay/labeler@1.0.4
|
||||||
if: ${{ fromJSON(steps.get-workflow-jobs.outputs.result).install == 'failure' }}
|
if: ${{ fromJSON(steps.get-workflow-jobs.outputs.result).install == 'failure' }}
|
||||||
with:
|
with:
|
||||||
repo-token: ${{ steps.get-app-token.outputs.token }}
|
repo-token: ${{ steps.generate-token.outputs.token }}
|
||||||
issue-number: ${{ steps.source-run-info.outputs.pullRequestNumber }}
|
issue-number: ${{ steps.source-run-info.outputs.pullRequestNumber }}
|
||||||
add-labels: "install:failed"
|
add-labels: "install:failed"
|
||||||
remove-labels: "install:ok"
|
remove-labels: "install:ok"
|
||||||
|
8
.github/workflows/stale.yaml
vendored
8
.github/workflows/stale.yaml
vendored
@ -10,9 +10,9 @@ jobs:
|
|||||||
stale:
|
stale:
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
steps:
|
steps:
|
||||||
- name: Get app-token
|
- name: Generate Token
|
||||||
uses: getsentry/action-github-app-token@v1
|
uses: tibdex/github-app-token@v1
|
||||||
id: get-app-token
|
id: generate-token
|
||||||
with:
|
with:
|
||||||
app_id: ${{ secrets.K8S_AT_HOME_APP_ID }}
|
app_id: ${{ secrets.K8S_AT_HOME_APP_ID }}
|
||||||
private_key: ${{ secrets.K8S_AT_HOME_APP_PRIVATE_KEY }}
|
private_key: ${{ secrets.K8S_AT_HOME_APP_PRIVATE_KEY }}
|
||||||
@ -20,7 +20,7 @@ jobs:
|
|||||||
- name: Check for stale issues and PRs
|
- name: Check for stale issues and PRs
|
||||||
uses: actions/stale@v4
|
uses: actions/stale@v4
|
||||||
with:
|
with:
|
||||||
repo-token: ${{ steps.get-app-token.outputs.token }}
|
repo-token: ${{ steps.generate-token.outputs.token }}
|
||||||
days-before-issue-stale: 60
|
days-before-issue-stale: 60
|
||||||
days-before-pr-stale: 60
|
days-before-pr-stale: 60
|
||||||
days-before-close: 14
|
days-before-close: 14
|
||||||
|
Loading…
Reference in New Issue
Block a user