graphql-engine/.github/workflows/changelog.yml
Shahidh K Muhammed 5bc95d2b7a
add workflow automations, update changelog (#4079)
Co-authored-by: Aravind Shankar <aravind@hasura.io>
2020-03-29 12:01:30 +05:30

35 lines
1.0 KiB
YAML

on: 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');
}