Updated API from documentation release #68
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
on: | |
push: | |
paths: | |
- 'api-specs/**' | |
workflow_dispatch: | |
name: "SDK Generator Postman" | |
permissions: {} | |
jobs: | |
diff: | |
name: "Show changes" | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Checkout api reference" | |
uses: actions/checkout@v3 | |
with: | |
path: commercetools-api-reference | |
- name: "Checkout previous api reference" | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 50 | |
path: commercetools-api-reference-previous | |
- name: 'Setup Java' | |
uses: actions/setup-java@v3 | |
with: | |
distribution: temurin | |
java-version: '16' | |
- name: Show commit ID | |
run: echo "previous=$(git log --format='%H' --no-merges -n 1 --skip 1)" >> $GITHUB_ENV | |
working-directory: commercetools-api-reference-previous | |
- name: "Switch to previous commit" | |
run: git checkout ${{ env.previous }} | |
working-directory: commercetools-api-reference-previous | |
- name: "Install codegen" | |
run: curl -o- -s https://raw.githubusercontent.com/commercetools/rmf-codegen/main/scripts/install.sh | bash | |
- name: "Calculate diff" | |
run: rmf-codegen diff -f JSON commercetools-api-reference-previous/api-specs/api/api.raml commercetools-api-reference/api-specs/api/api.raml | |
postman: | |
name: "Generate postman collection" | |
runs-on: ubuntu-latest | |
continue-on-error: true | |
steps: | |
- name: 'Setup Java' | |
uses: actions/setup-java@v3 | |
with: | |
distribution: temurin | |
java-version: '16' | |
- name: "Checkout api reference" | |
uses: actions/checkout@v3 | |
with: | |
path: commercetools-api-reference | |
- name: "Checkout postman collection" | |
uses: actions/checkout@v3 | |
with: | |
repository: 'commercetools/commercetools-postman-collection' | |
path: postman | |
ssh-key: ${{ secrets.POSTMAN_DEPLOY_KEY }} | |
- name: "Generate api postman collection" | |
run: sudo chmod 777 /usr/local/bin && make build | |
working-directory: postman | |
env: | |
RAML_FILE: "../commercetools-api-reference/api-specs/api/postman.raml" | |
LIB_NAME: "api" | |
- name: "Generate importapi postman collection" | |
run: sudo chmod 777 /usr/local/bin && make build | |
working-directory: postman | |
env: | |
RAML_FILE: "../commercetools-api-reference/api-specs/importapi/api.raml" | |
LIB_NAME: "import" | |
- name: "Generate connect postman collection" | |
run: sudo chmod 777 /usr/local/bin && make build | |
working-directory: postman | |
env: | |
RAML_FILE: "../commercetools-api-reference/api-specs/connect/api.raml" | |
LIB_NAME: "connect" | |
- name: "check pending changes" | |
run: echo "CHANGES_PENDING=`git status --porcelain -- ':(exclude)*gen.properties' | grep -c ^`" >> $GITHUB_ENV | |
working-directory: postman | |
- uses: stefanzweifel/git-auto-commit-action@v4 | |
if: env.CHANGES_PENDING != '0' && github.ref == 'refs/heads/main' | |
with: | |
repository: postman | |
branch: master | |
commit_message: "TASK: Updating Postman collection" | |
commit_user_name: Auto Mation | |
commit_user_email: [email protected] | |
commit_author: Auto Mation <[email protected]> |