mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-08-08 18:55:36 +08:00
[CI] Skip the workflow run for a pull request, if the same SHA was already built
This commit is contained in:
13
.github/workflows/build.yml
vendored
13
.github/workflows/build.yml
vendored
@@ -18,6 +18,7 @@ jobs:
|
||||
|
||||
preBuild:
|
||||
runs-on: ubuntu-20.04
|
||||
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository }}
|
||||
outputs:
|
||||
version: ${{ steps.version.outputs.value }}
|
||||
|
||||
@@ -446,14 +447,16 @@ jobs:
|
||||
steps:
|
||||
- name: Prepare Discord message
|
||||
run: |
|
||||
result=SUCCESS
|
||||
expr ${{ join(needs.*.outputs.warnings, ' + ') }} && result=WARNING
|
||||
echo ${{ join(needs.*.result, ' ') }} | grep -q fail && result=FAILED
|
||||
echo ${{ join(needs.*.result, ' ') }} | grep -q cancel && result=CANCELLED
|
||||
result=SKIPPED
|
||||
${{ contains(needs.*.result, 'success') }} && result=SUCCESS
|
||||
${{ contains(needs.*.outputs.warnings, 'true') }} && result=WARNING
|
||||
${{ contains(needs.*.result, 'cancelled') }} && result=CANCELLED
|
||||
${{ contains(needs.*.result, 'failure') }} && result=FAILED
|
||||
[[ $result = SKIPPED ]] && emoji=repeat
|
||||
[[ $result = SUCCESS ]] && emoji=white_check_mark
|
||||
[[ $result = WARNING ]] && emoji=warning
|
||||
[[ $result = FAILED ]] && emoji=x
|
||||
[[ $result = CANCELLED ]] && emoji=grey_question
|
||||
[[ $result = FAILED ]] && emoji=x
|
||||
echo "::set-env name=result::$result"
|
||||
echo "::set-env name=emoji::$emoji"
|
||||
- name: Send Discord message
|
||||
|
||||
@@ -31,10 +31,9 @@ while (<<>>)
|
||||
++$cmds{"::warning file=$result{file}::$result{msg}"};
|
||||
}
|
||||
}
|
||||
my @cmds = sort keys %cmds;
|
||||
my $count = scalar @cmds;
|
||||
print "$_\n" for @cmds;
|
||||
print "::set-output name=warnings::$count\n";
|
||||
my $bool = %cmds ? 'true' : 'false';
|
||||
print "$_\n" for sort keys %cmds;
|
||||
print "::set-output name=warnings::$bool\n";
|
||||
|
||||
sub extractWarning
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user