diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 12afa95a8..6a9b44814 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -117,7 +117,7 @@ jobs: - name: "Checkout repository 🛎" uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 with: - persist-credentials: false + persist-credentials: true - name: "Setup CI environment 🛠" uses: pydata/pydata-sphinx-theme/.github/actions/set-dev-env@4a1e7898d6c92dade5e489684277ab4ffd0eb053 @@ -203,10 +203,7 @@ jobs: # ensures this runs even if the coverage step does not continue - e.g. the # default coverage action will fail at first for external PRs, this is a workaround # to ensure the comment is posted - if: ${{ github.event.name == 'pull_request'}} - with: - # this is the workflow run ID of the `CI.yml` workflow - workflow_run_id: ${{ github.event.workflow_run.id }} + if: ${{ github.event_name == 'pull_request'}} permissions: contents: write pull-requests: write diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 56092e5ea..cc3bee67e 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -2,11 +2,7 @@ name: Post coverage comment on: workflow_call: - inputs: - # this is the workflow run ID of the `CI.yml` workflow - workflow_run_id: - required: true - type: string + jobs: test: name: "Display code coverage" @@ -16,30 +12,8 @@ jobs: contents: write # needed to edit the comment vs opening multiple ones actions: read steps: - - name: "Get the triggering workflow run details" - id: get-run - uses: octokit/request-action@dad4362715b7fb2ddedf9772c8670824af564f0d - with: - route: GET /repos/"${REPO}"/actions/runs/"${WORKFLOW_RUN_ID}" - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - REPO: ${{ github.repository }} - WORKFLOW_RUN_ID: ${{ inputs.workflow_run_id }} - - # this needs the .coverage file so we download from the CI workflow artifacts - - name: "Download coverage data 📥" - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 - with: - pattern: coverage-data-* - merge-multiple: true - github-token: ${{ secrets.GITHUB_TOKEN }} - run-id: ${{ inputs.workflow_run_id }} - - - name: "Check downloaded files" - run: ls -R - - name: "Post coverage comment 💬" uses: py-cov-action/python-coverage-comment-action@970a227e0c16ef4589a99a9970ab0ceb8c53059a with: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GITHUB_PR_RUN_ID: ${{ inputs.workflow_run_id }} + GITHUB_PR_RUN_ID: ${{ github.run_id }}