Skip to content
This repository has been archived by the owner on Dec 9, 2024. It is now read-only.

Upgrade Workflows/Actions #14

Upgrade Workflows/Actions

Upgrade Workflows/Actions #14

Workflow file for this run

name: LGTM Check
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
check-comments:
runs-on: ubuntu-latest
steps:
- name: Check for LGTM comment
uses: actions/github-script@v5
with:
script: |
const issue_number = context.issue.number;
const owner = context.repo.owner;
const repo = context.repo.repo;
const pull_request = await github.rest.pulls.get({
owner: owner,
repo: repo,
pull_number: issue_number
});
if (pull_request.data.draft) {
console.log('Pull request is a draft, passing check.');
return;
}
const comments = await github.rest.issues.listComments({
issue_number: issue_number,
owner: owner,
repo: repo
});
for (const comment of comments.data) {
if (comment.body.includes('LGTM')) {
console.log('LGTM comment found!');
return;
}
}
throw new Error('No LGTM comment found!');