Skip to content
Merged
Show file tree
Hide file tree
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
19 changes: 14 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,32 @@ on:
release:
types: [created]

permissions:
contents: read
packages: write # required to push the image to GHCR

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }} # ghcr.io/target/pull-request-code-coverage

jobs:
docker:
environment: deployment
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Docker Login
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }} # built-in token, no extra secrets needed
- name: Docker Build and Push
id: docker_build
uses: docker/build-push-action@v6
with:
push: true
tags: |
${{ secrets.DOCKER_REPO }}/pull-request-code-coverage:latest
${{ secrets.DOCKER_REPO }}/pull-request-code-coverage:${{ github.event.release.tag_name }}
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.event.release.tag_name }}
19 changes: 17 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,21 @@ Currently, this plugin supports two coverage file format.

This plugin works out of box for [Vela](https://github.com/go-vela),a CI/CD open-sourced by target

## Docker image

The plugin is published as a public Docker image to the GitHub Container Registry (GHCR) on every release:

```
ghcr.io/target/pull-request-code-coverage:latest
ghcr.io/target/pull-request-code-coverage:<release-tag>
```

Pull it with:

```
docker pull ghcr.io/target/pull-request-code-coverage:latest
```

## VELA Usage

### Jvm based projects
Expand All @@ -31,7 +46,7 @@ this project. Once you have that jacoco file, you can pass that path to coverage

```yaml
- name: check-pr-code-coverage
image: docker.target.com/app/pull-request-code-coverage
image: ghcr.io/target/pull-request-code-coverage:latest
pull: true
ruleset:
event: [pull_request]
Expand Down Expand Up @@ -65,7 +80,7 @@ Once you have coverage.xml same can be passed as an input to plugin shown below

```yaml
- name: check-pr-code-coverage
image: docker.target.com/app/pull-request-code-coverage
image: ghcr.io/target/pull-request-code-coverage:latest
pull: true
ruleset:
event: [pull_request]
Expand Down
Loading