Check YAML pre-commit hook (#1390)

This commit is contained in:
Bart Louwers
2023-07-18 12:33:38 +02:00
committed by GitHub
parent a5c3a1a849
commit 9fb206f4ec
2 changed files with 33 additions and 28 deletions

View File

@@ -11,34 +11,35 @@ runs:
using: "composite"
steps:
- run: echo Hello ${{ inputs.who-to-greet }}.
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#workflow_run
- name: 'Download render-test-result artifact'
uses: actions/github-script@v6
with:
script: |
let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: context.payload.workflow_run.id,
});
let matchArtifact = allArtifacts.data.artifacts.filter((artifact) => {
return artifact.name == ${{ inputs.artifact-name }}
})[0];
let download = await github.rest.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: matchArtifact.id,
archive_format: 'zip',
});
let fs = require('fs');
fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/${{ inputs.artifact-name }}.zip`, Buffer.from(download.data));
- name: 'Download render-test-result artifact'
uses: actions/github-script@v6
with:
script: |
let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: context.payload.workflow_run.id,
});
let matchArtifact = allArtifacts.data.artifacts.filter((artifact) => {
return artifact.name == ${{ inputs.artifact-name }}
})[0];
let download = await github.rest.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: matchArtifact.id,
archive_format: 'zip',
});
let fs = require('fs');
fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/${{ inputs.artifact-name }}.zip`, Buffer.from(download.data));
- name: Unzip artifact
run: unzip ${{ inputs.artifact-name }}.zip
- name: Unzip artifact
run: unzip ${{ inputs.artifact-name }}.zip
- name: "Check file existence"
uses: andstor/file-existence-action@v2.0.0
if: ${{ inputs.expect-files }}
with:
fail: true
files: ${{ inputs.expect-files }}
- name: "Check file existence"
uses: andstor/file-existence-action@v2.0.0
if: ${{ inputs.expect-files }}
with:
fail: true
files: ${{ inputs.expect-files }}

View File

@@ -1,4 +1,8 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-yaml
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v16.0.6
hooks: