Skip to content

Commit e848763

Browse files
author
Adam Dyess
authored
Correct workflow-runner organization which is missing (#576)
* Correct workflow-runner organization which is missing * test PR should filter downloads using repo_full_name * GH token is required when downloading artifacts from another run-id * Swap ORG to OWNER
1 parent a23cb8a commit e848763

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

.github/workflows/comment.yaml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
runs-on: ubuntu-24.04
2323
outputs:
2424
IS_PR: ${{ steps.call.outputs.IS_PR || steps.run.outputs.IS_PR }}
25-
ORG: ${{ steps.call.outputs.ORG || steps.run.outputs.ORG }}
25+
OWNER: ${{ steps.call.outputs.OWNER || steps.run.outputs.OWNER }}
2626
REPO: ${{ steps.call.outputs.REPO || steps.run.outputs.REPO }}
2727
RUN_ID: ${{ steps.call.outputs.RUN_ID || steps.run.outputs.RUN_ID }}
2828
REPO_FULL_NAME: ${{ steps.call.outputs.REPO_FULL_NAME || steps.run.outputs.REPO_FULL_NAME }}
@@ -36,16 +36,17 @@ jobs:
3636
echo "RUN_ID=${{ github.run_id }}" >> $GITHUB_OUTPUT
3737
REPO_FULL_NAME="${{ github.repository }}"
3838
parts=(${REPO_FULL_NAME//\// })
39-
echo "ORG=${parts[0]}" >> $GITHUB_OUTPUT
39+
echo "OWNER=${parts[0]}" >> $GITHUB_OUTPUT
4040
echo "REPO=${parts[1]}" >> $GITHUB_OUTPUT
41+
echo "REPO_FULL_NAME=${REPO_FULL_NAME}" >> $GITHUB_OUTPUT
4142
echo "SHA=${{ github.event.pull_request.head.sha }}" >> $GITHUB_OUTPUT
4243
echo "IS_PR=${{ github.event_name == 'pull_request' }}" >> $GITHUB_OUTPUT
4344
- name: Workflow run setup
4445
id: run
4546
if: github.event_name == 'workflow_run'
4647
run: |
4748
echo "RUN_ID=${{ github.event.workflow_run.id }}" >> $GITHUB_OUTPUT
48-
echo "ORG=${{ github.event.workflow_run.organization.login }}" >> $GITHUB_OUTPUT
49+
echo "OWNER=${{ github.event.workflow_run.repository.owner.login }}" >> $GITHUB_OUTPUT
4950
echo "REPO=${{ github.event.workflow_run.repository.name }}" >> $GITHUB_OUTPUT
5051
echo "REPO_FULL_NAME=${{ github.event.workflow_run.repository.full_name }}" >> $GITHUB_OUTPUT
5152
echo "SHA=${{ github.event.workflow_run.head_sha }}" >> $GITHUB_OUTPUT
@@ -60,17 +61,18 @@ jobs:
6061
- name: Download artifacts
6162
uses: actions/download-artifact@v4.1.8
6263
with:
64+
pattern: "${{ env.ARTIFACT_NAME }}-*"
65+
github-token: ${{ secrets.GITHUB_TOKEN }}
6366
repository: ${{ needs.setup-env.outputs.REPO_FULL_NAME }}
6467
run-id: ${{ needs.setup-env.outputs.RUN_ID }}
65-
pattern: "${{ env.ARTIFACT_NAME }}-*"
6668
- name: Comment on PR
6769
uses: actions/github-script@v7.0.1
6870
with:
6971
github-token: ${{ secrets.GITHUB_TOKEN }}
7072
script: |
7173
const fs = require('fs');
7274
const artifact = '${{ env.ARTIFACT_NAME }}';
73-
const owner = '${{ needs.setup-env.outputs.ORG }}';
75+
const owner = '${{ needs.setup-env.outputs.OWNER }}';
7476
const repo = '${{ needs.setup-env.outputs.REPO }}';
7577
const sha = '${{ needs.setup-env.outputs.SHA }}';
7678
const header = `## Test results for commit ${sha}\n\n`;

0 commit comments

Comments
 (0)