diff --git a/.github/workflows/trigger-postman-single-file.yml b/.github/workflows/trigger-postman-single-file.yml deleted file mode 100644 index 67d94d1..0000000 --- a/.github/workflows/trigger-postman-single-file.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: "Generate single file" - - -on: - workflow_dispatch: - inputs: - file: - description: 'OpenAPI filepath' - required: true - default: 'adyen-openapi/yaml/CheckoutService-v70.yaml' -jobs: - generate: - name: "Generate Postman Collection" - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 2 - - uses: actions/checkout@v3 - with: - repository: 'Adyen/adyen-openapi' - fetch-depth: 0 - path: 'adyen-openapi' - - uses: addnab/docker-run-action@v3 - with: - image: gcatanese/openapi-generator-postman-v2 - options: -v ${{ github.workspace }}:/usr/src/app - run: | - /usr/src/app/generateSingleFile.sh ${{ github.event.inputs.file }} - - uses: stefanzweifel/git-auto-commit-action@v4 - with: - commit_message: "Manual generation" - - name: push-adyen-collections-to-postman-javascript-action - id: process - uses: jlengrand/push-adyen-collections-to-postman-javascript-action@main - with: - postman-key: ${{ secrets.POSTMAN_API_KEY }} - workspace-id: ${{ secrets.POSTMAN_WORKSPACE_ID }} - path-to-process: "./postman" diff --git a/generateSingleFile.sh b/generateSingleFile.sh deleted file mode 100755 index bdce85b..0000000 --- a/generateSingleFile.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -# Generate Postman Collection from a given OpenAPI file -# - -# Sets working tools -if [[ $OSTYPE == 'darwin'* ]]; then - echo "MacOS detected. Alias sed to gsed." - alias sed=gsed -fi - -DATE=$(date +"%Y-%m-%d") - -echo "Generate Postman Collection from $1" -FILENAME=$1 -BASE=$(echo "$(basename "${FILENAME%.*}")") -NAME=$(echo $FILENAME | sed 's/-.*//' | sed 's/.*\///') -REAL_NAME=$(sed '/title:/!d;q' $FILENAME | sed 's/.*://') -VERSION=$(echo $FILENAME | sed 's/.*-v//' | sed 's/\..*//') - -# echo "Generating $FILENAME $BASE $NAME $REAL_NAME $VERSION $DATE" - -sed -i.bak "1s/.*/openapi: 3.0.3/" $FILENAME # downgrade version for compat -sed -i.bak2 "0,/title:.*/{s//title: $REAL_NAME\ (v$VERSION)/}" $FILENAME # Set unique name of API for Postman - -/script.sh generate \ - --additional-properties postmanVariables=YOUR_MERCHANT_ACCOUNT-YOUR_COMPANY_ACCOUNT-YOUR_BALANCE_PLATFORM,generatedVariables=YOUR_REFERENCE_NUMBER-YOUR_REFERENCE-YOUR_ORDER_NUMBER-YOUR_ORDER_NUMBER\ - -i $FILENAME \ - -o postman/$BASE - -mv postman/$BASE/postman.json postman/$BASE.json -rm -rf postman/$BASE diff --git a/runDockerSingleFile.sh b/runDockerSingleFile.sh deleted file mode 100644 index 532c8b8..0000000 --- a/runDockerSingleFile.sh +++ /dev/null @@ -1,10 +0,0 @@ - #!/bin/sh - -if [ ! -d /adyen-openapi ]; then - git clone https://github.com/Adyen/adyen-openapi.git -fi - -docker run --volume $(pwd):/usr/src/app --entrypoint /usr/src/app/generateSingleFile.sh gcatanese/openapi-generator-postman-v2 $1 - -# clean up -rm -rf adyen-openapi \ No newline at end of file