-
Notifications
You must be signed in to change notification settings - Fork 3
Refactoring action pushing to ReadMe bidir-sync repositories and update source to remove circular refs #203
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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? |
||
| 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 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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" | ||
|
|
@@ -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 | ||
|
|
@@ -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:" | ||
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.