Skip to content

Commit fb1b3a3

Browse files
authored
Update CCOA.yml
1 parent 64bbddd commit fb1b3a3

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

.github/workflows/CCOA.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,34 @@ jobs:
7373
body: "🚫All pull requests will be blocked to merge until Jan 6, 2025 due to CCOA",
7474
});
7575
}
76+
77+
- name: Comment on PR2
78+
if: steps.date_check.outputs.continue == 'true'
79+
uses: actions/github-script@v7
80+
with:
81+
github-token: ${{ secrets.GITHUB_TOKEN }}
82+
script: |
83+
// Fetch existing comments
84+
const comments = await github.rest.issues.listComments({
85+
owner: context.repo.owner,
86+
repo: context.repo.repo,
87+
issue_number: context.issue.number,
88+
});
89+
90+
// Check if the specific comment already exists
91+
const existingComment = comments.data.find(comment =>
92+
comment.body.includes("⚠️**Your changes in this PR will be released on Jan 14, 2025 due to CCOA (extend to Jan 6, 2025)**")
93+
);
94+
95+
if (existingComment) {
96+
console.log("Comment already exists. Skipping...");
97+
} else {
98+
console.log("No comment found. Adding a new one...");
99+
// Add a new comment
100+
await github.rest.issues.createComment({
101+
owner: context.repo.owner,
102+
repo: context.repo.repo,
103+
issue_number: context.issue.number,
104+
body: "⚠️**Your changes in this PR will be released on Jan 14, 2025 due to CCOA (extend to Jan 6, 2025)**",
105+
});
106+
}

0 commit comments

Comments
 (0)