mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-23 18:50:06 +08:00
chore: use single update status of diff action
This commit is contained in:
parent
4dfa7ddf5e
commit
2116659f52
@ -77,6 +77,16 @@ jobs:
|
||||
const mergedStatus = diffPassed ? 'success' : hasDiffFailed ? 'failure' : 'pending';
|
||||
console.log('Status:', mergedStatus);
|
||||
|
||||
const { data: currentStatuses } = await github.rest.repos.listCommitStatusesForRef({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
ref: prHeadSha,
|
||||
});
|
||||
|
||||
const currentStatus = currentStatuses.find(status => status.context === 'Visual Regression Diff Wait Approve');
|
||||
if (currentStatus && currentStatus.state === mergedStatus) {
|
||||
console.log('Status has not changed, no need to update:', currentStatus.state);
|
||||
} else {
|
||||
await github.rest.repos.createCommitStatus({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
@ -85,6 +95,7 @@ jobs:
|
||||
context: 'Visual Regression Diff Wait Approve',
|
||||
description: diffPassed ? 'Visual diff is acceptable' : 'Visual diff is not pass',
|
||||
});
|
||||
}
|
||||
|
||||
if (hasDiffSuccess || (hasDiffFailed && hasMemberApprove)) {
|
||||
return 'success';
|
||||
|
Loading…
Reference in New Issue
Block a user