|
53 | 53 | required: false |
54 | 54 | default: I have read the ICLA and I hereby sign this agreement. |
55 | 55 | type: string |
| 56 | + app-id: |
| 57 | + required: false |
| 58 | + default: "" |
| 59 | + type: string |
56 | 60 |
|
57 | 61 | jobs: |
58 | 62 | cla: |
@@ -132,10 +136,19 @@ jobs: |
132 | 136 | core.setOutput("corporate_authorization_display_name", corporateAuthorizationDisplayName); |
133 | 137 | core.setOutput("sign_comment", signComment); |
134 | 138 |
|
| 139 | + - name: Create GitHub App token |
| 140 | + id: app_token |
| 141 | + if: ${{ inputs.app-id != '' && secrets.CLA_APP_PRIVATE_KEY != '' }} |
| 142 | + uses: actions/create-github-app-token@v2 |
| 143 | + with: |
| 144 | + app-id: ${{ inputs.app-id }} |
| 145 | + private-key: ${{ secrets.CLA_APP_PRIVATE_KEY }} |
| 146 | + owner: ${{ github.repository_owner }} |
| 147 | + |
135 | 148 | - name: Persist signed contributors |
136 | 149 | uses: actions/github-script@v8 |
137 | 150 | with: |
138 | | - github-token: ${{ secrets.CLA_BOT_TOKEN != '' && secrets.CLA_BOT_TOKEN || secrets.GITHUB_TOKEN }} |
| 151 | + github-token: ${{ steps.app_token.outputs.token || secrets.CLA_BOT_TOKEN || secrets.GITHUB_TOKEN }} |
139 | 152 | script: | |
140 | 153 | const prNumber = |
141 | 154 | context.payload.pull_request?.number ?? |
@@ -292,7 +305,7 @@ jobs: |
292 | 305 | - name: Check and collect CLA signatures |
293 | 306 | uses: contributor-assistant/github-action@v2.6.1 |
294 | 307 | env: |
295 | | - GITHUB_TOKEN: ${{ secrets.CLA_BOT_TOKEN != '' && secrets.CLA_BOT_TOKEN || secrets.GITHUB_TOKEN }} |
| 308 | + GITHUB_TOKEN: ${{ steps.app_token.outputs.token || secrets.CLA_BOT_TOKEN || secrets.GITHUB_TOKEN }} |
296 | 309 | with: |
297 | 310 | path-to-document: https://github.com/${{ github.repository }}/blob/${{ inputs.default-branch }}/${{ inputs.icla-path }} |
298 | 311 | path-to-signatures: ${{ inputs.signatures-path }} |
|
0 commit comments