Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workflow updates #50

Merged
merged 9 commits into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/create-collection.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
name: "Create Postman Collection"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 2
- name: push-to-postman-action
Expand All @@ -27,4 +27,4 @@ jobs:
goal: create
postman-key: ${{ secrets.POSTMAN_API_KEY }}
postman-file: ${{ github.event.inputs.file }}
workspace-id: ${{ github.event.inputs.workspaceId }}
workspace-id: ${{ github.event.inputs.workspaceId }}
4 changes: 2 additions & 2 deletions .github/workflows/generate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:
name: "Generate Postman Collection"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 2
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
repository: 'adyen/adyen-openapi'
fetch-depth: 0
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/in-person-payments.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
name: "Update Postman Collection"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 2
- name: push-to-postman-action
Expand All @@ -22,4 +22,4 @@ jobs:
goal: update
postman-key: ${{ secrets.POSTMAN_API_KEY }}
postman-file: 'in-person-payments/ipp.json'
collection-id: ${{ secrets.POSTMAN_IPP_COLLECTION_ID }}
collection-id: ${{ secrets.POSTMAN_IPP_COLLECTION_ID }}
2 changes: 1 addition & 1 deletion .github/workflows/sync-collections.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
name: "Sync Postman collections"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: update-balance-control
uses: gcatanese/push-to-postman-action@main
with:
Expand Down
31 changes: 3 additions & 28 deletions .github/workflows/trigger-postman.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,46 +7,21 @@ on:
workflow_dispatch:

jobs:
issue:
name: "Creating GitHub update issue"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/checkout@v3
with:
repository: 'Adyen/adyen-openapi'
path: 'adyen-openapi'
fetch-depth: 0
- name: Get changed files in the yaml folder
id: changed-files-specific
uses: tj-actions/changed-files@v41
with:
files: yaml/*.yaml
path: 'adyen-openapi'
- uses: JasonEtco/create-an-issue@v2
if: ${{ steps.changed-files-specific.outputs.added_files != '' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
FILENAMES: ${{ steps.changed-files-specific.outputs.added_files }}
with:
filename: .github/ISSUE_TEMPLATE/openapi-changes.yml
generate:
name: "Generate latest definitions files"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 2
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
repository: 'Adyen/adyen-openapi'
fetch-depth: 0
path: 'adyen-openapi'
- uses: addnab/docker-run-action@v3
with:
image: gcatanese/openapi-generator-postman-v2
image: ghcr.io/adyen-examples/openapi-generator-postman-v2:main
options: -v ${{ github.workspace }}:/usr/src/app
run: |
/usr/src/app/generateAll.sh
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/update-collection.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
name: "Update Postman Collection"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 2
- name: push-to-postman-action
Expand All @@ -27,4 +27,4 @@ jobs:
goal: update
postman-key: ${{ secrets.POSTMAN_API_KEY }}
postman-file: ${{ github.event.inputs.file }}
collection-id: ${{ github.event.inputs.collectionId }}
collection-id: ${{ github.event.inputs.collectionId }}
3 changes: 0 additions & 3 deletions MAINTAINERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ The workflows rely on different custom actions :

When the workflow gets triggered :

* The `issue` job will be fired. It is meant to warn us something needs to be checked.
* This job checks what new files have been created in the adyen-openapi repository
* Creates a [GitHub issue](https://github.com/Adyen/adyen-postman/issues) with the list of those files and assigns it to us.
* The `generate` job will be fired
* This job first runs a script relying on [openapi-generator-postman-v2](https://github.com/gcatanese/openapi-generator-postman-v2). This script will take each yaml file in the adyen-openapi repository and generate a corresponding Postman compatible version from them.
* The `generateAll.sh` script contains an `ALLOW_LIST` that lists all APIs that should **NOT** be ignored. Everything else (classic, webhooks, newer APIs), is ignored by default.
Expand Down
2 changes: 1 addition & 1 deletion generateAll.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ fi

DATE=$(date +"%Y-%m-%d")
# We allow only non classic, non webhook APIs
ALLOW_LIST="BalanceControlService|BalancePlatformService|BinLookupService|CheckoutService|DataProtectionService|DisputeService|GrantService|LegalEntityService|PayoutService|RecurringService|StoredValueService|TestCardService|TfmAPIService|TransferService"
ALLOW_LIST="BalanceControlService|BalancePlatformService|BinLookupService|CheckoutService|DataProtectionService|DisputeService|GrantService|LegalEntityService|ManagementService|PayoutService|RecurringService|StoredValueService|TestCardService|TfmAPIService|TransferService"

for entry in "adyen-openapi/yaml"/*
do
Expand Down