|
26 | 26 | jobs: |
27 | 27 | pre-commit: |
28 | 28 | runs-on: ubuntu-latest |
29 | | - if: > |
30 | | - (github.event.pull_request.draft == false && |
31 | | - !contains(github.event.pull_request.labels.*.name, 'ci/skip') && |
32 | | - !contains(github.event.pull_request.head.ref, 'datadog-api-spec/test/')) || |
33 | | - github.event_name == 'schedule' |
34 | 29 | steps: |
35 | 30 | - name: Get GitHub App token |
36 | 31 | id: get_token |
37 | | - if: inputs.enable-commit-changes && github.event.pull_request.head.repo.full_name == github.repository |
| 32 | + if: inputs.enable-commit-changes |
38 | 33 | uses: actions/create-github-app-token@v1 |
39 | 34 | with: |
40 | 35 | app-id: ${{ secrets.PIPELINE_GITHUB_APP_ID }} |
41 | 36 | private-key: ${{ secrets.PIPELINE_GITHUB_APP_PRIVATE_KEY }} |
42 | 37 | - uses: actions/checkout@v3 |
43 | | - if: github.event.pull_request.head.repo.full_name == github.repository |
44 | 38 | with: |
| 39 | + fetch-depth: 0 |
45 | 40 | repository: DataDog/datadog-api-client-typescript |
46 | 41 | ref: ${{ inputs.target-branch || github.event.pull_request.head.sha || github.ref }} |
47 | | - fetch-depth: 50 |
48 | 42 | token: ${{ inputs.enable-commit-changes && steps.get_token.outputs.token || github.token }} |
49 | | - - uses: actions/checkout@v3 |
50 | | - if: github.event.pull_request.head.repo.full_name != github.repository |
51 | | - with: |
52 | | - repository: DataDog/datadog-api-client-typescript |
53 | | - ref: ${{ inputs.target-branch || github.event.pull_request.head.sha || github.ref }} |
54 | | - fetch-depth: 50 |
55 | 43 | - uses: actions/setup-python@v4 |
56 | 44 | with: |
57 | 45 | python-version: '3.11' |
|
78 | 66 | if: github.event.action != 'closed' && github.event.pull_request.merged != true |
79 | 67 | run: bash -c "./generate.sh" |
80 | 68 | - name: Commit changes |
81 | | - if: failure() && inputs.enable-commit-changes && github.event.pull_request.head.repo.full_name == github.repository |
| 69 | + if: ${{ failure() && inputs.enable-commit-changes }} |
82 | 70 | run: |- |
83 | 71 | git add -A |
84 | 72 | git config user.name "${GIT_AUTHOR_NAME}" |
|
0 commit comments