Check YAML pre-commit hook (#1390)
This commit is contained in:
@@ -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 }}
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user