|
19 | 19 | PIPELINE_GITHUB_APP_PRIVATE_KEY: |
20 | 20 | required: false |
21 | 21 |
|
| 22 | +env: |
| 23 | + GIT_AUTHOR_EMAIL: "packages@datadoghq.com" |
| 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-rust |
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-rust |
44 | | - ref: ${{ inputs.target-branch || github.ref }} |
45 | 43 | - name: Install pre-commit |
46 | 44 | run: python -m pip install pre-commit |
47 | 45 | - name: set PY |
|
66 | 64 | FROM_REF: ${{ steps.commit_range.outputs.from_ref }} |
67 | 65 | TO_REF: ${{ steps.commit_range.outputs.to_ref }} |
68 | 66 | - name: Commit changes |
69 | | - if: failure() && inputs.enable-commit-changes && github.event.pull_request.head.repo.full_name == github.repository |
| 67 | + if: ${{ failure() && inputs.enable-commit-changes }} |
70 | 68 | run: |- |
71 | 69 | git add -A |
72 | 70 | git config user.name "${GIT_AUTHOR_NAME}" |
|
76 | 74 | exit 1 |
77 | 75 | env: |
78 | 76 | HEAD_REF: ${{ github.event.pull_request.head.ref }} |
79 | | - GIT_AUTHOR_EMAIL: "packages@datadoghq.com" |
80 | | - GIT_AUTHOR_NAME: "ci.datadog-api-spec" |
81 | 77 | - id: pre_commit_schedule |
82 | 78 | name: Run pre-commit in schedule |
83 | 79 | if: github.event_name == 'schedule' |
|
0 commit comments