Skip to content

Update README.md

Update README.md #5

Workflow file for this run

name: Comment on merged PR
on:
pull_request:
types: [closed, labeled]
jobs:
comment:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Comment on PR
uses: actions/github-script@v3
with:
github-token: ${{secrets.GH_ACTIONS}}
script: |
const fs = require('fs');
const issue_number = context.issue.number;
const pr = await github.pulls.get(context.repo({pull_number: issue_number}));
const label_name = 'okayy';
const has_label = pr.data.labels.some(label => label.name === label_name);
if (pr.data.merged && has_label) {
const comment_body = `This PR has been merged! Thanks @${pr.data.user.login} for your contribution!\n\n![Image]()`;
await github.issues.createComment(context.repo({issue_number, body: comment_body}));
}