Skip to content
Open
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
Original file line number Diff line number Diff line change
@@ -1,28 +1,41 @@
name: Update MarketingSolutions Preview doc
name: Push Preview OAS to ReadMe documentation repositories

on:
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice, I wasn't aware of this feature; that's pretty near!

Btw, do you have clues whether both configs would run sequentially or in parallel?
I remember that Readme has some concurrency issues so we should ensure both don't run at the same time. (btw, not too sure either if it's enough to just have the 2 conf runs one directly after the other, or if it should sleep a bit in otder to let Readme processing of the first config be completed? 🤔 )

include:
- api: MarketingSolutions
ssh_secret: MARKETING_SOLUTIONS_PUBLIC_API_DOC_REPO_PRIVATE_KEY
repo: marketing-solutions-public-api-doc
oas_dest_name: criteo-api-1.json
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An alternative, that would lead to less complexity here, would be to rename the file in the destination repo, to have the name in both. I don't remember the details, but IIRC it should be rather straightforward. What about looking into it? (OTHO it can definitely be done afterwards, so that's just a suggestion)

- api: RetailMedia
ssh_secret: RETAIL_MEDIA_PUBLIC_API_DOC_REPO_PRIVATE_KEY
repo: retail-media-public-api-doc
oas_dest_name: criteo-api.json
name: ${{ matrix.api }}
steps:
- uses: actions/checkout@v6

- name: Setup SSH Agent for git operations
uses: webfactory/ssh-agent@v0.9.1
with:
ssh-private-key: ${{ secrets.MARKETING_SOLUTIONS_PUBLIC_API_DOC_REPO_PRIVATE_KEY }}
ssh-private-key: ${{ secrets[matrix.ssh_secret] }}

- name: Commit and push Preview OAS
run: |
git clone git@github.com:criteo/marketing-solutions-public-api-doc.git
cd marketing-solutions-public-api-doc
git clone git@github.com:criteo/${{ matrix.repo }}.git
cd ${{ matrix.repo }}
PREVIEW_BRANCH=$(git branch -a | grep preview | cut -d '/' -f3)
git checkout $PREVIEW_BRANCH
OAS_DEST_NAME=criteo-api-1.json
OAS_DEST_NAME=${{ matrix.oas_dest_name }}
OAS_DEST=reference/"$OAS_DEST_NAME"
cp ../api-specifications/marketingsolutions_preview.json "$OAS_DEST"
curl -fSsL "https://api.criteo.com/Preview/${{ matrix.api }}/open-api-specifications.json?removeCircularReferences=true" -o "$OAS_DEST"
chmod u+x ../scripts/regenerate_md_files.sh
../scripts/regenerate_md_files.sh "$OAS_DEST_NAME"
git add "$OAS_DEST"
Expand All @@ -45,7 +58,7 @@ jobs:
status: "${{ job.status }}"
channel: "C02J0CWR789"
username: "sdk-generation-bot"
text: "Autoupdate of MarketingSolutions Preview OAS in Readme repo."
text: "Autoupdate of ${{ matrix.api }} Preview OAS in Readme repo."
icon_emoji: ":bell:"

- name: Send failure notification
Expand All @@ -58,5 +71,5 @@ jobs:
status: "${{ job.status }}"
channel: "C02J0CWR789"
username: "sdk-generation-bot"
text: "Autoupdate of MarketingSolutions Preview OAS in Readme repo failure, check <https://github.com/criteo/criteo-api-sdk-generator/actions|action results>. <!subteam^S07BSM1MDN2>."
text: "Autoupdate of ${{ matrix.api }} Preview OAS in Readme repo failure, check <https://github.com/criteo/criteo-api-sdk-generator/actions|action results>. <!subteam^S07BSM1MDN2>."
icon_emoji: ":x:"
62 changes: 0 additions & 62 deletions .github/workflows/update_retailmedia_preview_doc.yml

This file was deleted.