|
34 | 34 | shell: "bash" |
35 | 35 | run: "${GITHUB_ACTION_PATH}/bin/composer_version_check.sh ${{ github.event.client_payload.requirements.minimumComposerVersion }}" |
36 | 36 |
|
| 37 | + - name: Store commit info |
| 38 | + id: commit_info |
| 39 | + run: | |
| 40 | + git log -1 --format="HASH=%H" >> $GITHUB_OUTPUT |
| 41 | + git log -1 --format="AUTHOR=%an" >> $GITHUB_OUTPUT |
| 42 | + git log -1 --format="MESSAGE=%s" >> $GITHUB_OUTPUT |
| 43 | + shell: bash |
| 44 | + |
37 | 45 | - name: Configure Composer authentication |
38 | 46 | shell: "bash" |
39 | 47 | if: ${{ github.event.client_payload.composerAuthentication.type == 'environment' }} |
@@ -95,9 +103,53 @@ runs: |
95 | 103 |
|
96 | 104 | - name: Call webhook from Private Packagist to create the pull request |
97 | 105 | shell: bash |
98 | | - run: "curl -fsSL -X POST -u ${{ github.event.client_payload.webhook.authentication.username }}:${{ github.event.client_payload.webhook.authentication.password }} --header \"Content-Type: application/json\" --data '{\"runId\":\"${{github.run_id}}\",\"numberOfChangedFiles\":\"${{ steps.number_of_changed_files.outputs.COUNT }}\",\"versions\":{\"ciScriptVersion\":\"1.4.0\"}}' ${{ github.event.client_payload.webhook.executedUrl }}" |
| 106 | + env: |
| 107 | + RUN_ID: ${{ github.run_id }}; |
| 108 | + CHANGED_FILES: ${{ steps.number_of_changed_files.outputs.COUNT }} |
| 109 | + COMMIT_HASH: ${{ steps.commit_info.outputs.HASH }}, |
| 110 | + COMMIT_AUTHOR: ${{ steps.commit_info.outputs.AUTHOR }}, |
| 111 | + COMMIT_MESSAGE: ${{ steps.commit_info.outputs.MESSAGE }} |
| 112 | + CI_VERSION: "1.5.0" |
| 113 | + run: | |
| 114 | + jq -n '{ |
| 115 | + "runId": env.RUN_ID, |
| 116 | + "numberOfChangedFiles": env.CHANGED_FILES, |
| 117 | + "commitInfo": { |
| 118 | + "hash": env.COMMIT_HASH, |
| 119 | + "author": env.COMMIT_AUTHOR, |
| 120 | + "message": env.COMMIT_MESSAGE |
| 121 | + }, |
| 122 | + "versions": { |
| 123 | + "ciScriptVersion": env.CI_VERSION |
| 124 | + } |
| 125 | + }' | curl -fsSL -X POST \ |
| 126 | + -u "${{ github.event.client_payload.webhook.authentication.username }}:${{ github.event.client_payload.webhook.authentication.password }}" \ |
| 127 | + --header "Content-Type: application/json" \ |
| 128 | + --data @- \ |
| 129 | + "${{ github.event.client_payload.webhook.executedUrl }}" |
99 | 130 |
|
100 | 131 | - name: Call webhook from Private Packagist to notify about build failure |
101 | 132 | shell: bash |
| 133 | + env: |
| 134 | + RUN_ID: ${{ github.run_id }} |
| 135 | + COMMIT_HASH: ${{ steps.commit_info.outputs.HASH }} |
| 136 | + COMMIT_AUTHOR: ${{ steps.commit_info.outputs.AUTHOR }} |
| 137 | + COMMIT_MESSAGE: ${{ steps.commit_info.outputs.MESSAGE }} |
| 138 | + CI_VERSION: 1.5.0 |
102 | 139 | if: ${{ failure() }} |
103 | | - run: "curl -fsSL -X POST -u ${{ github.event.client_payload.webhook.authentication.username }}:${{ github.event.client_payload.webhook.authentication.password }} --header \"Content-Type: application/json\" --data '{\"runId\":\"${{github.run_id}}\",\"versions\":{\"ciScriptVersion\":\"1.4.0\"}}' ${{ github.event.client_payload.webhook.errorUrl }}" |
| 140 | + run: | |
| 141 | + jq -n '{ |
| 142 | + "runId": env.RUN_ID, |
| 143 | + "commitInfo": { |
| 144 | + "hash": env.COMMIT_HASH, |
| 145 | + "author": env.COMMIT_AUTHOR, |
| 146 | + "message": env.COMMIT_MESSAGE |
| 147 | + }, |
| 148 | + "versions": { |
| 149 | + "ciScriptVersion": env.CI_VERSION |
| 150 | + } |
| 151 | + }' | curl -fsSL -X POST \ |
| 152 | + -u "${{ github.event.client_payload.webhook.authentication.username }}:${{ github.event.client_payload.webhook.authentication.password }}" \ |
| 153 | + --header "Content-Type: application/json" \ |
| 154 | + --data @- \ |
| 155 | + "${{ github.event.client_payload.webhook.errorUrl }}" |
0 commit comments