mirror of
https://github.com/k8s-at-home/charts.git
synced 2025-01-24 07:59:02 +00:00
ci: Debug
Signed-off-by: Bᴇʀɴᴅ Sᴄʜᴏʀɢᴇʀs <me@bjw-s.dev>
This commit is contained in:
parent
0f8ad35215
commit
1fdcfebbcb
182
.github/workflows/metadata-label-pr-ci-status.yaml
vendored
182
.github/workflows/metadata-label-pr-ci-status.yaml
vendored
@ -2,92 +2,120 @@
|
|||||||
name: "Metadata: Label pull requests CI status"
|
name: "Metadata: Label pull requests CI status"
|
||||||
|
|
||||||
on:
|
on:
|
||||||
check_suite:
|
workflows:
|
||||||
# workflows:
|
- "Pre-commit consistency check"
|
||||||
# - "Pre-commit consistency check"
|
- "Charts: Lint and test"
|
||||||
# - "Charts: Lint and test"
|
types:
|
||||||
# types:
|
- completed
|
||||||
# - completed
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
get-info:
|
get-info:
|
||||||
name: "Get information about the source run"
|
name: "Get information about the source run"
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
# outputs:
|
outputs:
|
||||||
# pullRequestNumber: ${{ steps.source-run-info.outputs.pullRequestNumber }}
|
pullRequestNumber: ${{ steps.source-run-info.outputs.pullRequestNumber }}
|
||||||
steps:
|
steps:
|
||||||
# - 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: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
# sourceRunId: ${{ github.event.workflow_run.id }}
|
sourceRunId: ${{ github.event.workflow_run.id }}
|
||||||
|
|
||||||
|
label-precommit:
|
||||||
|
name: Label pre-commit status
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
if: |
|
||||||
|
${{ github.event.workflow.name == 'Pre-commit consistency check' }}
|
||||||
|
needs:
|
||||||
|
- get-info
|
||||||
|
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: "Pre-commit successful"
|
||||||
|
uses: actions/github-script@v4
|
||||||
|
if: ${{ github.event.workflow_run.conclusion == 'success' }}
|
||||||
|
with:
|
||||||
|
github-token: ${{ steps.get-app-token.outputs.token }}
|
||||||
|
script: |
|
||||||
|
github.issues.addLabels({
|
||||||
|
issue_number: context.needs.get-info.outputs.pullRequestNumber,
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
labels: ['precommit:ok']
|
||||||
|
})
|
||||||
|
github.issues.removeLabel({
|
||||||
|
issue_number: context.needs.get-info.outputs.pullRequestNumber,
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
labels: ['precommit:failed']
|
||||||
|
})
|
||||||
|
result-encoding: string
|
||||||
|
|
||||||
|
- name: "Pre-commit failed"
|
||||||
|
uses: actions/github-script@v4
|
||||||
|
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
|
||||||
|
with:
|
||||||
|
github-token: ${{ steps.get-app-token.outputs.token }}
|
||||||
|
script: |
|
||||||
|
github.issues.addLabels({
|
||||||
|
issue_number: context.needs.get-info.outputs.pullRequestNumber,
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
labels: ['precommit:failed']
|
||||||
|
})
|
||||||
|
github.issues.removeLabel({
|
||||||
|
issue_number: context.needs.get-info.outputs.pullRequestNumber,
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
labels: ['precommit:ok']
|
||||||
|
})
|
||||||
|
result-encoding: string
|
||||||
|
|
||||||
|
label-lint-install:
|
||||||
|
name: Label lint and install status
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
if: |
|
||||||
|
${{ github.event.workflow.name == 'Charts: Lint and tests' }}
|
||||||
|
needs:
|
||||||
|
- get-info
|
||||||
|
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: "Lint successful"
|
||||||
|
uses: actions/github-script@v4
|
||||||
|
with:
|
||||||
|
github-token: ${{ steps.get-app-token.outputs.token }}
|
||||||
|
script: |
|
||||||
|
const wfJobs = github.actions.listJobsForWorkflowRun({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
run_id: context.event.workflow_run.id,
|
||||||
|
});
|
||||||
|
console.log(wfJobs)
|
||||||
|
# github.issues.addLabels({
|
||||||
|
# issue_number: context.needs.get-info.outputs.pullRequestNumber,
|
||||||
|
# owner: context.repo.owner,
|
||||||
|
# repo: context.repo.repo,
|
||||||
|
# labels: ['lint:ok']
|
||||||
|
# })
|
||||||
|
# github.issues.removeLabel({
|
||||||
|
# issue_number: context.needs.get-info.outputs.pullRequestNumber,
|
||||||
|
# owner: context.repo.owner,
|
||||||
|
# repo: context.repo.repo,
|
||||||
|
# labels: ['lint:failed']
|
||||||
|
# })
|
||||||
|
|
||||||
- uses: hmarr/debug-action@v2
|
- uses: hmarr/debug-action@v2
|
||||||
|
|
||||||
# label-precommit:
|
|
||||||
# name: Label pre-commit status
|
|
||||||
# runs-on: ubuntu-20.04
|
|
||||||
# if: ${{ github.event.workflow.name == 'Pre-commit consistency check' }}
|
|
||||||
# needs:
|
|
||||||
# - get-info
|
|
||||||
# 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 }}
|
|
||||||
|
|
||||||
# # 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 }}
|
|
||||||
# number: ${{ needs.get-info.outputs.pullRequestNumber }}
|
|
||||||
# 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 }}
|
|
||||||
# number: ${{ needs.get-info.outputs.pullRequestNumber }}
|
|
||||||
# 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 }}
|
|
||||||
# number: ${{ needs.get-info.outputs.pullRequestNumber }}
|
|
||||||
# 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 }}
|
|
||||||
# number: ${{ needs.get-info.outputs.pullRequestNumber }}
|
|
||||||
# labels: "precommit:ok"
|
|
||||||
|
|
||||||
# label-lint:
|
|
||||||
# name: Label lint status
|
|
||||||
# runs-on: ubuntu-20.04
|
|
||||||
# if: |
|
|
||||||
# ${{ github.event.workflow.name == 'Charts: Lint and tests' }}
|
|
||||||
# needs:
|
|
||||||
# - get-info
|
|
||||||
# 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
|
# # # CI Passed
|
||||||
# # - name: "add label: ok"
|
# # - name: "add label: ok"
|
||||||
# # uses: actions-ecosystem/action-add-labels@v1
|
# # uses: actions-ecosystem/action-add-labels@v1
|
||||||
|
Loading…
Reference in New Issue
Block a user