ci: Fix CI checks for forks

Signed-off-by: Bᴇʀɴᴅ Sᴄʜᴏʀɢᴇʀs <me@bjw-s.dev>
This commit is contained in:
Bᴇʀɴᴅ Sᴄʜᴏʀɢᴇʀs 2021-07-24 13:03:17 +02:00
parent a5b459cdfc
commit 849709775d
No known key found for this signature in database
GPG Key ID: 228A77789D71A6E2
3 changed files with 53 additions and 124 deletions

View File

@ -92,16 +92,9 @@ jobs:
name: Lint charts
runs-on: ubuntu-20.04
steps:
- uses: getsentry/action-github-app-token@v1
id: get-app-token
with:
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.get-app-token.outputs.token }}
fetch-depth: 0
- name: Install Helm
@ -120,52 +113,15 @@ jobs:
id: lint
run: ct lint --config .github/ct-lint.yaml
# CI Passed
- name: "add label: ok"
uses: actions-ecosystem/action-add-labels@v1
if: ${{ success() }}
with:
github_token: ${{ steps.get-app-token.outputs.token }}
labels: "lint:ok"
- name: "remove label: failed"
uses: actions-ecosystem/action-remove-labels@v1
if: ${{ success() }}
with:
github_token: ${{ steps.get-app-token.outputs.token }}
labels: "lint:failed"
# CI Failed
- name: "add label: failed"
uses: actions-ecosystem/action-add-labels@v1
if: ${{ failure() }}
with:
github_token: ${{ steps.get-app-token.outputs.token }}
labels: "lint:failed"
- name: "remove label: ok"
uses: actions-ecosystem/action-remove-labels@v1
if: ${{ failure() }}
with:
github_token: ${{ steps.get-app-token.outputs.token }}
labels: "lint:ok"
unittest:
needs:
- lint
name: Run unit tests
runs-on: ubuntu-20.04
steps:
- uses: getsentry/action-github-app-token@v1
id: get-app-token
with:
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.get-app-token.outputs.token }}
fetch-depth: 0
- name: Install Dev tools
@ -204,16 +160,9 @@ jobs:
max-parallel: 15
runs-on: ubuntu-20.04
steps:
- uses: getsentry/action-github-app-token@v1
id: get-app-token
with:
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.get-app-token.outputs.token }}
fetch-depth: 0
- name: Install Helm
@ -249,42 +198,6 @@ jobs:
name: Install successful
runs-on: ubuntu-20.04
steps:
- uses: getsentry/action-github-app-token@v1
id: get-app-token
with:
app_id: ${{ secrets.K8S_AT_HOME_APP_ID }}
private_key: ${{ secrets.K8S_AT_HOME_APP_PRIVATE_KEY }}
- name: Check install matrix status
if: ${{ needs.changes-install.outputs.detected == 'true' && needs.install.result != 'success' }}
run: exit 1
# CI Passed
- name: "add label: ok"
uses: actions-ecosystem/action-add-labels@v1
if: ${{ success() }}
with:
github_token: ${{ steps.get-app-token.outputs.token }}
labels: "install:ok"
- name: "remove label: failed"
uses: actions-ecosystem/action-remove-labels@v1
if: ${{ success() }}
with:
github_token: ${{ steps.get-app-token.outputs.token }}
labels: "install:failed"
# CI Failed
- name: "add label: failed"
uses: actions-ecosystem/action-add-labels@v1
if: ${{ failure() }}
with:
github_token: ${{ steps.get-app-token.outputs.token }}
labels: "install:failed"
- name: "remove label: ok"
uses: actions-ecosystem/action-remove-labels@v1
if: ${{ failure() }}
with:
github_token: ${{ steps.get-app-token.outputs.token }}
labels: "install:ok"

View File

@ -0,0 +1,53 @@
---
name: "Metadata: Label pull requests CI status"
on:
workflow_run:
workflows:
- "Pre-commit consistency check"
types:
- completed
jobs:
label-precommit:
name: Label pre-commit status
runs-on: ubuntu-20.04
# if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- uses: getsentry/action-github-app-token@v1
id: get-app-token
with:
app_id: ${{ secrets.K8S_AT_HOME_APP_ID }}
private_key: ${{ secrets.K8S_AT_HOME_APP_PRIVATE_KEY }}
- uses: hmarr/debug-action@v2
# # CI Passed
# - name: "add label: ok"
# uses: actions-ecosystem/action-add-labels@v1
# if: ${{ github.event.workflow_run.conclusion == 'success' }}
# with:
# github_token: ${{ steps.get-app-token.outputs.token }}
# labels: "precommit:ok"
# - name: "remove label: failed"
# uses: actions-ecosystem/action-remove-labels@v1
# if: ${{ github.event.workflow_run.conclusion == 'success' }}
# with:
# github_token: ${{ steps.get-app-token.outputs.token }}
# labels: "precommit:failed"
# # CI Failed
# - name: "add label: failed"
# uses: actions-ecosystem/action-add-labels@v1
# if: ${{ github.event.workflow_run.conclusion == 'failure' }}
# with:
# github_token: ${{ steps.get-app-token.outputs.token }}
# labels: "precommit:failed"
# - name: "remove label: ok"
# uses: actions-ecosystem/action-remove-labels@v1
# if: ${{ github.event.workflow_run.conclusion == 'failure' }}
# with:
# github_token: ${{ steps.get-app-token.outputs.token }}
# labels: "precommit:ok"

View File

@ -13,16 +13,9 @@ jobs:
name: Run pre-commit checks
runs-on: ubuntu-20.04
steps:
- uses: getsentry/action-github-app-token@v1
id: get-app-token
with:
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.get-app-token.outputs.token }}
fetch-depth: 0
- uses: dorny/paths-filter@v2
@ -46,33 +39,3 @@ jobs:
if: steps.filter.outputs.addedOrModified != 'true'
with:
extra_args: --all-files
# CI Passed
- name: "add label: ok"
uses: actions-ecosystem/action-add-labels@v1
if: ${{ success() }}
with:
github_token: ${{ steps.get-app-token.outputs.token }}
labels: "precommit:ok"
- name: "remove label: failed"
uses: actions-ecosystem/action-remove-labels@v1
if: ${{ success() }}
with:
github_token: ${{ steps.get-app-token.outputs.token }}
labels: "precommit:failed"
# CI Failed
- name: "add label: failed"
uses: actions-ecosystem/action-add-labels@v1
if: ${{ failure() }}
with:
github_token: ${{ steps.get-app-token.outputs.token }}
labels: "precommit:failed"
- name: "remove label: ok"
uses: actions-ecosystem/action-remove-labels@v1
if: ${{ failure() }}
with:
github_token: ${{ steps.get-app-token.outputs.token }}
labels: "precommit:ok"