|
18 | 18 | workflow_call: |
19 | 19 | inputs: |
20 | 20 | # Path to a JSON file containing the members of the org. This should be |
21 | | - # the full path from the repo root without a leading `/`. |
| 21 | + # the full path that should work with the https://raw.githubusercontent.com/ prefix. |
22 | 22 | # See the README for more. |
23 | 23 | org-members-path: |
24 | 24 | required: true |
|
43 | 43 | - name: 'Checkout the calling repo' |
44 | 44 | uses: 'actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683' # ratchet:actions/checkout@v4 |
45 | 45 |
|
| 46 | + - name: Download members.json |
| 47 | + id: 'download-members-json' |
| 48 | + run: |- |
| 49 | + MEMBERS_JSON="${RUNNER_TEMP}/${GITHUB_SHA:0:7}.members.json" |
| 50 | +
|
| 51 | + # Download the file, passing in authentication to get a higher rate |
| 52 | + # limit: https://docs.github.com/en/rest/overview/resources-in-the-rest-api?apiVersion=2022-11-28#rate-limits-for-requests-from-github-actions |
| 53 | + curl "https://raw.githubusercontent.com/${{ inputs.org-members-path }}" \ |
| 54 | + --silent \ |
| 55 | + --fail \ |
| 56 | + --location \ |
| 57 | + --header "Authorization: Token ${{ github.token }}" \ |
| 58 | + --output "${MEMBERS_JSON}" |
| 59 | +
|
| 60 | + # Save the result to an output. |
| 61 | + echo "::notice::Downloaded members.json to ${MEMBERS_JSON}" |
| 62 | + echo "output-file=${MEMBERS_JSON}" >> "${GITHUB_OUTPUT}" |
| 63 | +
|
46 | 64 | - name: 'Download multi-approvers.js' |
47 | 65 | id: 'download-multi-approvers-js' |
48 | 66 | run: |- |
|
66 | 84 | with: |
67 | 85 | retries: 3 |
68 | 86 | script: |- |
69 | | - const orgMembersPath = '${{ github.action_path }}/${{ inputs.org-members-path }}'; |
| 87 | + const orgMembersPath = '${{ steps.download-members-json.outputs.output-file }}'; |
70 | 88 | // Warning: this should not be quoted, otherwise comparisons will not work in JS. |
71 | 89 | const prNumber = ${{ github.event.pull_request.number }} |
72 | 90 | const repoName = '${{ github.event.repository.name }}' |
|
0 commit comments