mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-15 01:12:56 +03:00
920c6ea427
* ci: add hlint escape hatch Co-authored-by: Antoine Leblanc <antoine@hasura.io> GITHUB_PR_NUMBER: 6164 GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/6164 * Applied changes to new workflow files. * Add missing label trigger for lint worklow Co-authored-by: Antoine Leblanc <antoine@hasura.io> GitOrigin-RevId: 3e22c301a9412f7f77978b35f29c38c7876ac13f
35 lines
1.0 KiB
YAML
35 lines
1.0 KiB
YAML
on: [label, pull_request]
|
|
name: changelog
|
|
jobs:
|
|
check:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/github-script@0.9.0
|
|
with:
|
|
script: |
|
|
const labels = await github.issues.listLabelsOnIssue({
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
issue_number: context.payload.pull_request.number,
|
|
});
|
|
for (const label of labels.data) {
|
|
if (label.name === 'no-changelog-required') {
|
|
return;
|
|
}
|
|
}
|
|
const files = await github.pulls.listFiles({
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
pull_number: context.payload.pull_request.number,
|
|
});
|
|
let changeLogPresent = false;
|
|
for (const file of files.data) {
|
|
if (file.filename === 'CHANGELOG.md') {
|
|
changeLogPresent = true;
|
|
break;
|
|
}
|
|
}
|
|
if (!changeLogPresent) {
|
|
core.setFailed('changelog is required');
|
|
}
|