mirror of
https://github.com/gcatanese/adyen-postman.git
synced 2026-03-10 08:01:18 +00:00
Remove generate single file workflow
This commit is contained in:
@@ -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"
|
||||
@@ -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
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user