Skip to content

External PR

External PR #4533

Workflow file for this run

name: External PR
on:
workflow_run:
workflows: ["Java CI"]
types:
- completed
jobs:
comment:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' }}
name: Comment
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: 'Download artifact'
uses: actions/github-script@v7
with:
script: |
var artifacts = await github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: ${{github.event.workflow_run.id }},
});
var matchArtifact = artifacts.data.artifacts.filter((artifact) => {
return artifact.name == "pr"
})[0];
var download = await github.rest.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: matchArtifact.id,
archive_format: 'zip',
});
var fs = require('fs');
fs.writeFileSync('${{github.workspace}}/pr.zip', Buffer.from(download.data));
- run: unzip pr.zip
- name: outputs
run: |-
echo "PR=$(cat NR)" >> $GITHUB_ENV
echo "SHA=$(cat SHA)" >> $GITHUB_ENV
- name: Check compatibility
run: >-
pip3 -q install agithub &&
python3 .github/scripts/binaryCompatibility.py --input japicmp/default-cli.xml
--token "${{ github.token }}" --pr "${{ env.PR }}" --sha "${{ env.SHA }}"
- name: cobertura-report-unit-test
uses: 5monkeys/cobertura-action@v14
continue-on-error: true
with:
# The GITHUB_TOKEN for this repo
repo_token: ${{ github.token }}
# Path to the cobertura file.
path: jacoco-report/cobertura.xml
# If files with 100% should be skipped from report.
skip_covered: false
# Minimum allowed coverage percentage as an integer.
minimum_coverage: 65
# Show line rate as specific column.
show_line: true
# Show branch rate as specific column.
show_branch: true
# Use class names instead of the filename
show_class_names: true
# Use a unique name for the report and comment
report_name: Unit Tests Coverage Report
pull_request_number: ${{ env.PR }}
- name: cobertura-report-integration-test
uses: 5monkeys/cobertura-action@v14
continue-on-error: true
with:
# The GITHUB_TOKEN for this repo
repo_token: ${{ github.token }}
# Path to the cobertura file.
path: jacoco-report/cobertura-it.xml
# If files with 100% should be skipped from report.
skip_covered: false
# Minimum allowed coverage percentage as an integer.
minimum_coverage: 58
# Show line rate as specific column.
show_line: true
# Show branch rate as specific column.
show_branch: true
# Use class names instead of the filename
show_class_names: true
# Use a unique name for the report and comment
report_name: Integration Tests Coverage Report
pull_request_number: ${{ env.PR }}