Update SDKs #22
This file contains 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 SDKs | |
on: | |
workflow_dispatch: | |
pull_request: | |
branches: [ "main" ] | |
permissions: | |
contents: read | |
jobs: | |
generate: | |
strategy: | |
matrix: | |
project: [ go, php, java, node, dotnet, python, ruby ] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '11' | |
distribution: 'temurin' | |
- name: Clone ${{ matrix.project }} repository | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.ADYEN_AUTOMATION_BOT_ACCESS_TOKEN }} | |
repository: Adyen/adyen-${{ matrix.project }}-api-library | |
path: ${{ matrix.project }}/repo | |
- name: Generate code for ${{ matrix.project }} | |
uses: gradle/gradle-build-action@bd5760595778326ba7f1441bcf7e88b49de61a25 # v2.6.0 | |
with: | |
arguments: ${{ matrix.project }}:services | |
- name: Set PR variables | |
id: vars | |
run: | | |
cd schema | |
echo pr_title="Update all services" >> "$GITHUB_OUTPUT" | |
echo pr_body="OpenAPI spec or templates produced changes on $(date +%d-%m-%Y) \ | |
by [commit](https://github.com/Adyen/adyen-openapi/commit/$(git rev-parse HEAD))." >> "$GITHUB_OUTPUT" | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@153407881ec5c347639a548ade7d8ad1d6740e38 # v5.0.2 | |
with: | |
path: ${{ matrix.project }}/repo | |
token: ${{ secrets.ADYEN_AUTOMATION_BOT_ACCESS_TOKEN }} | |
committer: ${{ secrets.ADYEN_AUTOMATION_BOT_EMAIL }} | |
author: ${{ secrets.ADYEN_AUTOMATION_BOT_EMAIL }} | |
branch: sdk-automation/models | |
title: ${{ steps.vars.outputs.pr_title }} | |
body: ${{ steps.vars.outputs.pr_body }} |