I am attempting to deploy pages with the specified configuration, an error occurred due to the absence of any uploaded artifact. The deployment process couldn’t find the artifact named "coverage-report"
as specified in the deployment action. But in the pipeline and in output i can see that there is an artifact uploaded with the name of "coverage-report"
, even the Artifact ID is also created.
This is my pipeline logs:-
> Run actions/upload-artifact@v4
With the provided path, there will be 1 file uploaded
Artifact 'coverage-report' (ID: 1512371137) deleted
Artifact name is valid!
Root directory input is valid!
Beginning upload of artifact content to blob storage
Uploaded bytes 3503
Finished uploading artifact content to blob storage!
SHA256 hash of uploaded artifact zip is 16b48eb6ed684e0aba7f41fff8da8ed05e28183b97c4c08f19c0b6aa063caf0c
Finalizing artifact upload
Artifact coverage-report.zip successfully finalized. Artifact ID 1518618736
Artifact coverage-report has been successfully uploaded! Final size is 3503 bytes. Artifact ID is 1518618736
Artifact download URL: https://github.com/Sonichigo/mux-postgresQL/actions/runs/9123784355/artifacts/1518618736
> Run actions/deploy-pages@v3
with:
artifact_name: coverage-report
token: ***
timeout: 600000
error_count: 10
reporting_interval: 5000
preview: false
Artifact exchange URL: https://pipelinesghubeus10.actions.githubusercontent.com/RyaceIjGjj5Wyj3ugxgIox9jX04VXetUleDwfBLlpVjSqp5WgH/_apis/pipelines/workflows/9123784355/artifacts?api-version=6.0-preview
Error: Error: No uploaded artifact was found! Please check if there are any errors at build step, or uploaded artifact name is correct.
at getSignedArtifactMetadata (/home/runner/work/_actions/actions/deploy-pages/v3/src/internal/api-client.js:94:1)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at Deployment.create (/home/runner/work/_actions/actions/deploy-pages/v3/src/internal/deployment.js:68:1)
at main (/home/runner/work/_actions/actions/deploy-pages/v3/src/index.js:30:1)
This is my custom action.yml
outputs:
coverage-report-file:
description: 'Path to the generated coverage report file'
value: ${{ steps.generate-report.outputs.report-file }}
runs:
using: 'composite'
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.22.*
- name: Generate coverage report
id: generate-report
run: |
PKG_DIR="${{ inputs.package-directory || './...' }}"
COVERAGE_FILE="${{ inputs.coverage-file || 'coverage-report' }}"
go test -race -coverprofile=$COVERAGE_FILE.out $PKG_DIR
go tool cover -html=$COVERAGE_FILE.out -o $COVERAGE_FILE.html
COVERAGE_PERCENTAGE=$(go tool cover -func=$COVERAGE_FILE.out | grep total: | awk '{print substr($3, 1, length($3)-1)}')
if (( $(echo "$COVERAGE_PERCENTAGE < ${{ inputs.coverage-threshold }}" | bc -l) )); then
echo "Error: Coverage $COVERAGE_PERCENTAGE% is below the required threshold of ${{ inputs.coverage-threshold }}%"
exit 1
fi
echo "report-file=$COVERAGE_FILE.html" >> $GITHUB_OUTPUT
shell: bash
- name: Upload coverage report artifact
id: upload-artifact
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: ${{ steps.generate-report.outputs.report-file }}
overwrite: true
retention-days: 4
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v3
with:
artifact_name: coverage-report
token: ${{ github.token }}
- name: Comment coverage report link
if: ${{ github.event_name == 'pull_request' }}
uses: actions/github-script@v6
with:
github-token: ${{ github.token }}
script: |
const issueNumber = context.issue.number;
const repo = context.repo.repo;
const owner = context.repo.owner;
github.rest.issues.createComment({
issue_number: issueNumber,
owner: context.repo.owner,
repo: context.repo.repo,
body: `See the coverage report at: [Deployment Log](${{ steps.deployment.outputs.page_url }})`
});