Skip to content

[ECS-Plugin] Document for user #136

[ECS-Plugin] Document for user

[ECS-Plugin] Document for user #136

Workflow file for this run

name: Contributor Thank You
on:
pull_request_target:
types:
- closed
permissions:
pull-requests: write
contents: read
jobs:
thank-you:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Leave a Thank You Comment
uses: actions/github-script@v7
with:
script: |
const fs = require('fs');
const creator = context.payload.pull_request.user.login;
if (creator.endsWith('[bot]')) {
console.log('Skipping bot account.');
return;
}
const maintainersData = JSON.parse(fs.readFileSync('MAINTAINERS.json', 'utf8'));
const maintainers = maintainersData.maintainers.map(m => m.toLowerCase());
if (maintainers.includes(creator.toLowerCase())) {
console.log(`Skipping maintainer account: ${creator}`);
return;
}
const message = `Thank you for contributing to PipeCD, @${creator}! The changes in this pull request will be part of the upcoming release!`;
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.pull_request.number,
body: message
});