mirror of
https://github.com/django/django.git
synced 2025-12-23 09:19:27 +00:00
Refs #36620 -- Fixed PR number extraction in coverage_comment workflow.
Some checks failed
Linters / flake8 (push) Has been cancelled
Linters / isort (push) Has been cancelled
Linters / black (push) Has been cancelled
Linters / zizmor (push) Has been cancelled
Tests / Windows, SQLite, Python 3.14 (push) Has been cancelled
Tests / JavaScript tests (push) Has been cancelled
Some checks failed
Linters / flake8 (push) Has been cancelled
Linters / isort (push) Has been cancelled
Linters / black (push) Has been cancelled
Linters / zizmor (push) Has been cancelled
Tests / Windows, SQLite, Python 3.14 (push) Has been cancelled
Tests / JavaScript tests (push) Has been cancelled
Passing the PR number as an artifact is more reliable in cross-fork workflows.
This commit is contained in:
parent
020e5799ad
commit
fd4c5fa3ed
2 changed files with 19 additions and 6 deletions
13
.github/workflows/coverage_comment.yml
vendored
13
.github/workflows/coverage_comment.yml
vendored
|
|
@ -8,6 +8,7 @@ on:
|
|||
|
||||
permissions:
|
||||
contents: read
|
||||
actions: read
|
||||
pull-requests: write
|
||||
|
||||
jobs:
|
||||
|
|
@ -20,16 +21,22 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 60
|
||||
steps:
|
||||
- name: Download diff coverage report
|
||||
- name: Download coverage artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: diff-coverage-report-${{ github.event.workflow_run.pull_requests[0].number }}
|
||||
name: coverage-artifacts
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
run-id: ${{ github.event.workflow_run.id }}
|
||||
|
||||
- name: Read PR number
|
||||
id: pr
|
||||
run: |
|
||||
pr_number=$(cat pr_number.txt)
|
||||
echo "number=$pr_number" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Post/update PR comment
|
||||
env:
|
||||
PR_NUMBER: ${{ github.event.workflow_run.pull_requests[0].number }}
|
||||
PR_NUMBER: ${{ steps.pr.outputs.number }}
|
||||
uses: actions/github-script@v8
|
||||
with:
|
||||
script: |
|
||||
|
|
|
|||
12
.github/workflows/coverage_tests.yml
vendored
12
.github/workflows/coverage_tests.yml
vendored
|
|
@ -66,10 +66,16 @@ jobs:
|
|||
Set-Content -Path diff-cover-report.md -Value 'No coverage data available.'
|
||||
}
|
||||
|
||||
- name: Upload diff coverage report
|
||||
- name: Save PR number
|
||||
if: success()
|
||||
run: echo "${{ github.event.pull_request.number }}" > pr_number.txt
|
||||
|
||||
- name: Upload artifacts
|
||||
if: success()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: diff-coverage-report-${{ github.event.pull_request.number }}
|
||||
path: diff-cover-report.md
|
||||
name: coverage-artifacts
|
||||
path: |
|
||||
diff-cover-report.md
|
||||
pr_number.txt
|
||||
retention-days: 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue