Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 2 additions & 9 deletions .github/workflows/thank-you.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,9 @@ permissions:

jobs:
thank-you:
# Only run if the PR was actually merged
if: github.event.pull_request.merged
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
# We must check out the code to read the MAINTAINERS.json file
- name: Checkout repository
uses: actions/checkout@v4

Expand All @@ -26,29 +24,24 @@ jobs:
const fs = require('fs');
const creator = context.payload.pull_request.user.login;

// Skip bots to avoid comment loops
if (creator.endsWith('[bot]')) {
console.log('Skipping bot account.');
return;
}

// Read maintainers list from JSON file
const maintainersData = JSON.parse(fs.readFileSync('MAINTAINERS.json', 'utf8'));
const maintainers = maintainersData.maintainers.map(m => m.toLowerCase());

// Skip core maintainers to avoid spamming the team
if (maintainers.includes(creator.toLowerCase())) {
console.log(`Skipping maintainer account: ${creator}`);
return;
}

const message = 'Thank you for contributing to PipeCD! The changes in this pull request will be part of the upcoming release!';
const message = `Thank you for contributing to PipeCD, @${creator}! The changes in this pull request will be part of the upcoming release!`;

// Post the comment to the PR
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.pull_request.number,
body: message
});

Loading