Update native headers #380
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Update native headers | |
| on: | |
| repository_dispatch: | |
| types: [update_headers] | |
| workflow_dispatch: | |
| inputs: | |
| url: | |
| description: 'URL of the native headers' | |
| type: 'string' | |
| required: true | |
| ai_json_url: | |
| description: 'URL of the AI JSON' | |
| type: 'string' | |
| required: false | |
| version: | |
| description: 'native headers version' | |
| type: 'string' | |
| required: true | |
| product_type: | |
| description: 'product type' | |
| type: 'string' | |
| required: true | |
| jobs: | |
| update-headers: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| with: | |
| persist-credentials: false | |
| - name: Update headers | |
| run: | | |
| bash scripts/update_headers.sh ${{ inputs.url }} ${{ inputs.version }} ${{ inputs.product_type }} | |
| shell: bash | |
| - name: Fetch AI JSON if ai_json_url is provided | |
| if: ${{ inputs.ai_json_url != '' }} | |
| uses: ./.github/actions/fetch_ai_json | |
| with: | |
| url: ${{ inputs.ai_json_url }} | |
| product_type: ${{ inputs.product_type }} | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Push custom headers to GitHub | |
| run: | | |
| git config --global user.name "${{ secrets.GIT_USERNAME }}" | |
| git config --global user.email "${{ secrets.GIT_EMAIL }}" | |
| git add headers/* | |
| git commit -m "[AUTO] Update native headers to ${{ inputs.product_type }}_${{ inputs.version }}" | |
| git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} | |
| git push origin main |