Remove generate single file workflow

This commit is contained in:
Beppe Catanese
2023-08-22 08:58:44 +02:00
parent 2b4478e5e3
commit e1d2ad6e95
3 changed files with 0 additions and 81 deletions

View File

@@ -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"

View File

@@ -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

View File

@@ -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