diff --git a/.github/workflows/run-rsfc.yml b/.github/workflows/run-rsfc.yml index a63cb68..bdfdd04 100644 --- a/.github/workflows/run-rsfc.yml +++ b/.github/workflows/run-rsfc.yml @@ -9,6 +9,9 @@ on: is_fork: required: true type: boolean + pr_sha: + required: false + type: string secrets: RSFC_TOKEN: required: false @@ -82,15 +85,16 @@ jobs: uses: actions/github-script@v7 with: script: | - const pr = context.payload.pull_request const jobId = "${{ steps.get_job.outputs.job_id }}" - const url = `https://github.com/${context.payload.repository.owner.login}/${context.payload.repository.name}/actions/runs/${context.runId}/job/${jobId}` + const headSha = "${{ inputs.pr_sha || github.sha }}" + const owner = context.repo.owner + const repo = context.repo.repo await github.rest.checks.create({ - owner: context.payload.repository.owner.login, - repo: context.payload.repository.name, + owner: owner, + repo: repo, name: "View report RSFC", - head_sha: pr.head.sha, + head_sha: headSha, status: "completed", conclusion: "neutral", output: { diff --git a/.github/workflows/use-rsfc.yml b/.github/workflows/use-rsfc.yml index 2906214..cbc547f 100644 --- a/.github/workflows/use-rsfc.yml +++ b/.github/workflows/use-rsfc.yml @@ -11,5 +11,6 @@ jobs: with: repo_url: https://github.com/${{ github.repository }} is_fork: ${{ github.event.pull_request.head.repo.full_name != github.repository }} + pr_sha: ${{ github.event.pull_request.head.sha }} secrets: - RSFC_TOKEN: ${{ secrets.RSFC_TOKEN }} \ No newline at end of file + RSFC_TOKEN: ${{ secrets.RSFC_TOKEN }} diff --git a/README.md b/README.md index 5c1cab5..dfcd0b9 100644 --- a/README.md +++ b/README.md @@ -252,7 +252,6 @@ To download it: 2. Select the job **Run RSFC Analysis** 3. Download the artifact from the **Artifacts** section - Example: ```yaml @@ -268,5 +267,7 @@ jobs: uses: oeg-upm/rsfc/.github/workflows/run-rsfc.yml@main with: repo_url: https://github.com/${{ github.repository }} + is_fork: ${{ github.event.pull_request.head.repo.full_name != github.repository }} + pr_sha: ${{ github.event.pull_request.head.sha }} secrets: RSFC_TOKEN: ${{ secrets.RSFC_TOKEN }}