1010jobs :
1111 publish :
1212 runs-on : ubuntu-latest
13+ environment : prod
1314 outputs :
1415 release_number : ${{steps.get_latest_release_number.outputs.release_tag}}
1516 permissions :
@@ -100,4 +101,54 @@ jobs:
100101 job_url : " https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}"
101102 button_type : " danger"
102103 package_version : ${{needs.publish.outputs.release_number}}
103- repo_link : ${{github.server_url}}/${{github.repository}}
104+ repo_link : ${{github.server_url}}/${{github.repository}}
105+ notify-codegen-repo :
106+ needs : publish
107+ if : always()
108+ runs-on : ubuntu-latest
109+ permissions :
110+ contents : write
111+ pull-requests : write
112+
113+ steps :
114+ - name : Checkout
115+ uses : actions/checkout@v4
116+ with :
117+ repository : XeroAPI/xero-ruby
118+ path : xero-ruby
119+
120+ - name : Install octokit dependencies
121+ run : npm i
122+ working-directory : xero-ruby/.github/octokit
123+
124+ - name : Get github app access token
125+ id : get_access_token
126+ env :
127+ GITHUB_APP_ID : ${{ secrets.XERO_CODEGEN_BOT_APPLICATION_ID }}
128+ GITHUB_APP_PRIVATE_KEY : ${{ secrets.XERO_CODEGEN_BOT_APPLICATION_KEY }}
129+ uses : actions/github-script@v7
130+ with :
131+ result-encoding : string
132+ script : |
133+ const { getAccessToken } = await import('${{ github.workspace }}/xero-ruby/.github/octokit/index.js')
134+ const token = await getAccessToken()
135+ return token
136+
137+ - name : Notify codegen repo
138+ run : |
139+ curl -X POST -H "Authorization: token ${{ steps.get_access_token.outputs.result }}" \
140+ -H "Accept: application/vnd.github.v3+json" \
141+ -H "Content-Type: application/json" \
142+ https://api.github.com/repos/xero-internal/xeroapi-sdk-codegen/actions/workflows/notify-sdk-publish.yml/dispatches \
143+ -d '{
144+ "ref": "master",
145+ "inputs": {
146+ "commit": "${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}",
147+ "status": "${{needs.publish.result}}",
148+ "deployer": "xero-codegen-bot",
149+ "url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}",
150+ "environment": "prod",
151+ "sdk_type": "ruby",
152+ "cab_key": "${{ github.event.inputs.cab_id }}"
153+ }
154+ }'
0 commit comments