|  | 
| 19 | 19 |       PIPELINE_GITHUB_APP_PRIVATE_KEY: | 
| 20 | 20 |         required: false | 
| 21 | 21 | 
 | 
|  | 22 | +env: | 
|  | 23 | +  GIT_AUTHOR_EMAIL: "[email protected]" | 
|  | 24 | +  GIT_AUTHOR_NAME: "ci.datadog-api-spec" | 
|  | 25 | + | 
| 22 | 26 | jobs: | 
| 23 | 27 |   pre-commit: | 
| 24 | 28 |     runs-on: ubuntu-latest | 
| 25 | 29 |     steps: | 
| 26 | 30 |       - name: Get GitHub App token | 
| 27 |  | -        if: inputs.enable-commit-changes && github.event.pull_request.head.repo.full_name == github.repository | 
| 28 | 31 |         id: get_token | 
|  | 32 | +        if: inputs.enable-commit-changes | 
| 29 | 33 |         uses: actions/create-github-app-token@v1 | 
| 30 | 34 |         with: | 
| 31 | 35 |           app-id: ${{ secrets.PIPELINE_GITHUB_APP_ID }} | 
| 32 | 36 |           private-key: ${{ secrets.PIPELINE_GITHUB_APP_PRIVATE_KEY }} | 
| 33 | 37 |       - uses: actions/checkout@v3 | 
| 34 |  | -        if: github.event.pull_request.head.repo.full_name == github.repository | 
| 35 | 38 |         with: | 
| 36 | 39 |           fetch-depth: 0 | 
| 37 | 40 |           repository: DataDog/datadog-api-client-java | 
| 38 | 41 |           ref: ${{ inputs.target-branch || github.event.pull_request.head.sha || github.ref }} | 
| 39 | 42 |           token: ${{ inputs.enable-commit-changes && steps.get_token.outputs.token || github.token }} | 
| 40 |  | -      - uses: actions/checkout@v3 | 
| 41 |  | -        if: github.event.pull_request.head.repo.full_name != github.repository | 
| 42 |  | -        with: | 
| 43 |  | -          repository: DataDog/datadog-api-client-java | 
| 44 |  | -          ref: ${{ inputs.target-branch || github.ref }} | 
| 45 | 43 |       - uses: actions/setup-python@v4 | 
| 46 | 44 |         with: | 
| 47 | 45 |           python-version: '3.11' | 
|  | 
| 76 | 74 |           FROM_REF: ${{ steps.commit_range.outputs.from_ref }} | 
| 77 | 75 |           TO_REF: ${{ steps.commit_range.outputs.to_ref }} | 
| 78 | 76 |       - name: Commit changes | 
| 79 |  | -        if: failure() && inputs.enable-commit-changes && github.event.pull_request.head.repo.full_name == github.repository | 
|  | 77 | +        if: failure() && inputs.enable-commit-changes | 
| 80 | 78 |         run: |- | 
| 81 | 79 |           git add -A | 
| 82 | 80 |           git config user.name "${GIT_AUTHOR_NAME}" | 
|  | 
| 86 | 84 |           exit 1 | 
| 87 | 85 |         env: | 
| 88 | 86 |           HEAD_REF: ${{ github.event.pull_request.head.ref }} | 
| 89 |  | -          GIT_AUTHOR_EMAIL: "[email protected]" | 
| 90 |  | -          GIT_AUTHOR_NAME: "ci.datadog-api-spec" | 
| 91 | 87 |       - id: pre_commit_schedule | 
| 92 | 88 |         name: Run pre-commit in schedule | 
| 93 | 89 |         if: github.event_name == 'schedule' | 
|  | 
0 commit comments