Show icon and index of a pull request in pipelines triggered by pull requests (#575)

Co-authored-by: 6543 <6543@obermui.de>
This commit is contained in:
Anbraten 2021-12-08 14:15:24 +01:00 committed by GitHub
parent db2fbc699a
commit fe2f269bce
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 3 deletions

View file

@ -33,7 +33,10 @@
<Icon v-else-if="build.event === 'deployment'" name="deployment" /> <Icon v-else-if="build.event === 'deployment'" name="deployment" />
<Icon v-else-if="build.event === 'tag'" name="tag" /> <Icon v-else-if="build.event === 'tag'" name="tag" />
<Icon v-else name="push" /> <Icon v-else name="push" />
<span class="truncate">{{ build.branch }}</span> <span v-if="build.event === 'pull_request'" class="truncate">{{
`#${build.ref.replaceAll('refs/pull/', '').replaceAll('/merge', '').replaceAll('/head', '')}`
}}</span>
<span v-else class="truncate">{{ build.branch }}</span>
</div> </div>
<div class="flex space-x-2 items-center"> <div class="flex space-x-2 items-center">
<Icon name="commit" /> <Icon name="commit" />

View file

@ -35,11 +35,15 @@
<Icon v-else-if="build.event === 'deployment'" name="deployment" /> <Icon v-else-if="build.event === 'deployment'" name="deployment" />
<Icon v-else-if="build.event === 'tag'" name="tag" /> <Icon v-else-if="build.event === 'tag'" name="tag" />
<Icon v-else name="push" /> <Icon v-else name="push" />
<span>{{ build.branch }}</span> <a v-if="build.event === 'pull_request'" class="text-link" :href="build.link_url" target="_blank">{{
`#${build.ref.replaceAll('refs/pull/', '').replaceAll('/merge', '').replaceAll('/head', '')}`
}}</a>
<span v-else>{{ build.branch }}</span>
</div> </div>
<div class="flex space-x-2 items-center"> <div class="flex space-x-2 items-center">
<Icon name="commit" /> <Icon name="commit" />
<a class="text-link" :href="build.link_url" target="_blank">{{ build.commit.slice(0, 10) }}</a> <span v-if="build.event === 'pull_request'">{{ build.commit.slice(0, 10) }}</span>
<a v-else class="text-link" :href="build.link_url" target="_blank">{{ build.commit.slice(0, 10) }}</a>
</div> </div>
<div class="flex space-x-2 items-center"> <div class="flex space-x-2 items-center">
<Icon name="since" /> <Icon name="since" />