ci: Debug

Signed-off-by: Bᴇʀɴᴅ Sᴄʜᴏʀɢᴇʀs <me@bjw-s.dev>
This commit is contained in:
Bᴇʀɴᴅ Sᴄʜᴏʀɢᴇʀs 2021-07-24 16:36:47 +02:00
parent fc9ecd6d02
commit 6cf95a59f0
No known key found for this signature in database
GPG Key ID: 228A77789D71A6E2

View File

@ -28,39 +28,36 @@ jobs:
token: ${{ steps.get-app-token.outputs.token }} token: ${{ steps.get-app-token.outputs.token }}
sourceRunId: ${{ github.event.workflow_run.id }} sourceRunId: ${{ github.event.workflow_run.id }}
# CI Passed - name: "Label precommit status"
- name: "add label: ok" uses: actions/github-script@v4
uses: actions-ecosystem/action-add-labels@v1
if: ${{ github.event.workflow_run.conclusion == 'success' }}
with: with:
github_token: ${{ steps.get-app-token.outputs.token }} github-token: ${{ steps.get-app-token.outputs.token }}
number: ${{ steps.source-run-info.outputs.pullRequestNumber }} script: |
labels: "precommit:ok" var LABEL_ADD
var LABEL_REMOVE
if (${{ github.event.workflow_run.conclusion }} == 'success') {
LABEL_ADD = 'precommit:ok'
LABEL_REMOVE = 'precommit:failed'
} else {
LABEL_ADD = 'precommit:failed'
LABEL_REMOVE = 'precommit:ok'
}
- name: "remove label: failed" github.issues.addLabels({
uses: actions-ecosystem/action-remove-labels@v1 issue_number: ${{ steps.source-run-info.outputs.pullRequestNumber }},
if: ${{ github.event.workflow_run.conclusion == 'success' }} owner: context.repo.owner,
with: repo: context.repo.repo,
github_token: ${{ steps.get-app-token.outputs.token }} labels: [LABEL_ADD]
number: ${{ steps.source-run-info.outputs.pullRequestNumber }} })
labels: "precommit:failed" try {
github.issues.removeLabel({
# CI Failed issue_number: ${{ steps.source-run-info.outputs.pullRequestNumber }},
- name: "add label: failed" owner: context.repo.owner,
uses: actions-ecosystem/action-add-labels@v1 repo: context.repo.repo,
if: ${{ github.event.workflow_run.conclusion == 'failure' }} name: [LABEL_REMOVE]
with: })
github_token: ${{ steps.get-app-token.outputs.token }} }
number: ${{ steps.source-run-info.outputs.pullRequestNumber }} } catch (error) {}
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: ${{ steps.source-run-info.outputs.pullRequestNumber }}
labels: "precommit:ok"
label-lint-install: label-lint-install:
name: Label lint and install status name: Label lint and install status
@ -105,42 +102,64 @@ jobs:
console.log(result) console.log(result)
return result return result
# # CI Passed - name: "Label lint status"
# - 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: "lint: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: "lint:failed"
- name: "Lint failed"
uses: actions/github-script@v4 uses: actions/github-script@v4
if: ${{ fromJSON(steps.get-workflow-jobs.outputs.result).lint == 'failure' }}
env:
LABEL_OK: "lint:ok"
LABEL_FAILED: "lint:failed"
with: with:
github-token: ${{ steps.get-app-token.outputs.token }} github-token: ${{ steps.get-app-token.outputs.token }}
script: | script: |
const { LABEL_OK, LABEL_FAILED } = process.env var LABEL_ADD
var LABEL_REMOVE
if (${{ fromJSON(steps.get-workflow-jobs.outputs.result).lint}} == 'success') {
LABEL_ADD = 'lint:ok'
LABEL_REMOVE = 'lint:failed'
} else {
LABEL_ADD = 'lint:failed'
LABEL_REMOVE = 'lint:ok'
}
github.issues.addLabels({ github.issues.addLabels({
issue_number: ${{ steps.source-run-info.outputs.pullRequestNumber }}, issue_number: ${{ steps.source-run-info.outputs.pullRequestNumber }},
owner: context.repo.owner, owner: context.repo.owner,
repo: context.repo.repo, repo: context.repo.repo,
labels: [LABEL_FAILED] labels: [LABEL_ADD]
}) })
try {
github.issues.removeLabel({ github.issues.removeLabel({
issue_number: ${{ steps.source-run-info.outputs.pullRequestNumber }}, issue_number: ${{ steps.source-run-info.outputs.pullRequestNumber }},
owner: context.repo.owner, owner: context.repo.owner,
repo: context.repo.repo, repo: context.repo.repo,
name: [LABEL_OK] name: [LABEL_REMOVE]
}) })
}
} catch (error) {}
- name: "Label install status"
uses: actions/github-script@v4
with:
github-token: ${{ steps.get-app-token.outputs.token }}
script: |
var LABEL_ADD
var LABEL_REMOVE
if (${{ fromJSON(steps.get-workflow-jobs.outputs.result).install}} == 'success') {
LABEL_ADD = 'install:ok'
LABEL_REMOVE = 'install:failed'
} else {
LABEL_ADD = 'install:failed'
LABEL_REMOVE = 'install:ok'
}
github.issues.addLabels({
issue_number: ${{ steps.source-run-info.outputs.pullRequestNumber }},
owner: context.repo.owner,
repo: context.repo.repo,
labels: [LABEL_ADD]
})
try {
github.issues.removeLabel({
issue_number: ${{ steps.source-run-info.outputs.pullRequestNumber }},
owner: context.repo.owner,
repo: context.repo.repo,
name: [LABEL_REMOVE]
})
}
} catch (error) {}