@@ -110,3 +110,54 @@ jobs:
110110 button_type : " danger"
111111 package_version : ${{needs.publish.outputs.release_number}}
112112 repo_link : ${{github.server_url}}/${{github.repository}}
113+
114+ notify-codegen-repo :
115+ needs : publish
116+ if : always()
117+ runs-on : ubuntu-latest
118+ permissions :
119+ contents : write
120+ pull-requests : write
121+
122+ steps :
123+ - name : Checkout
124+ uses : actions/checkout@v4
125+ with :
126+ repository : XeroAPI/xero-node
127+ path : xero-node
128+
129+ - name : Install octokit dependencies
130+ run : npm i
131+ working-directory : ${{ github.workspace }}/.github/octokit
132+
133+ - name : Get github app access token
134+ id : get_access_token
135+ env :
136+ GITHUB_APP_ID : ${{ secrets.XERO_CODEGEN_BOT_APPLICATION_ID }}
137+ GITHUB_APP_PRIVATE_KEY : ${{ secrets.XERO_CODEGEN_BOT_APPLICATION_KEY }}
138+ uses : actions/github-script@v7
139+ with :
140+ result-encoding : string
141+ script : |
142+ const { getAccessToken } = await import('${{ github.workspace }}/.github/octokit/index.js')
143+ const token = await getAccessToken()
144+ return token
145+
146+ - name : Notify codegen repo
147+ run : |
148+ curl -X POST -H "Authorization: token ${{ steps.get_access_token.outputs.result }}" \
149+ -H "Accept: application/vnd.github.v3+json" \
150+ -H "Content-Type: application/json" \
151+ https://api.github.com/repos/xero-internal/xeroapi-sdk-codegen/actions/workflows/notify-sdk-publish.yml/dispatches \
152+ -d '{
153+ "ref": "deploy-track-pipeline-changes",
154+ "inputs": {
155+ "commit": "${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}",
156+ "status": "${{needs.publish.result}}",
157+ "deployer": "xero-codegen-bot",
158+ "url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}",
159+ "environment": "test",
160+ "sdk_type": "node",
161+ "cab_key": ${{ github.event.inputs.cab_id }}
162+ }
163+ }'
0 commit comments