Skip to content
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
36 changes: 15 additions & 21 deletions .github/workflows/en-api-docs.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# The name of this GH action
name: Process EN Branch
name: Process en branch

# Defines when this action should be run
on:
Expand All @@ -15,28 +15,26 @@ jobs:
process-en-branch:
# We run this on the latest ubuntu
runs-on: ubuntu-latest
timeout-minutes: 15
timeout-minutes: 10

strategy:
matrix:
node-version: [24.x]

steps:
- name: Check out the en branch
- name: Check out scripts from main branch
uses: actions/checkout@v4
with:
ref: en
ref: refs/heads/main
sparse-checkout: |
.github/scripts
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0

- name: Check out scripts from main branch
- name: Check out api schemas from en branch
uses: actions/checkout@v4
with:
ref: main
sparse-checkout: |
.github/scripts
sparse-checkout-cone-mode: false
path: .main-scripts
ref: refs/heads/en
path: openapi
token: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Node.js
Expand All @@ -45,21 +43,17 @@ jobs:
node-version: ${{ matrix.node-version }}

- name: Install script dependencies
working-directory: .main-scripts/.github/scripts
working-directory: .github/scripts
run: npm install

- name: Run add-code-samples script
working-directory: .main-scripts/.github/scripts
run: npm run add-code-samples -- "../../.." "openapi.*\\.json"

- name: Cleanup working directory
run: rm -rf .main-scripts
working-directory: .github/scripts
run: npm run add-code-samples -- "../../openapi" "openapi.*\\.json"

- name: Push processed files to en-api-docs branch
- name: Push openapi directory to en-api-docs branch
uses: s0/git-publish-subdir-action@v2.6.0
env:
REPO: self
BRANCH: en-api-docs
FOLDER: .
BRANCH: refs/heads/en-api-docs
FOLDER: openapi
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MESSAGE: "Add SDK code samples to OpenAPI files"
41 changes: 17 additions & 24 deletions .github/workflows/jp-api-docs.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# The name of this GH action
name: Process JP Branch
name: Process jp branch

# Defines when this action should be run
on:
Expand All @@ -15,28 +15,26 @@ jobs:
process-jp-branch:
# We run this on the latest ubuntu
runs-on: ubuntu-latest
timeout-minutes: 15
timeout-minutes: 10

strategy:
matrix:
node-version: [24.x]

steps:
- name: Check out the jp branch
- name: Check out scripts from main branch
uses: actions/checkout@v4
with:
ref: jp
ref: refs/heads/main
sparse-checkout: |
.github/scripts
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0

- name: Check out scripts from main branch
- name: Check out api schemas from jp branch
uses: actions/checkout@v4
with:
ref: main
sparse-checkout: |
.github/scripts
sparse-checkout-cone-mode: false
path: .main-scripts
ref: refs/heads/jp
path: openapi
token: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Node.js
Expand All @@ -45,26 +43,21 @@ jobs:
node-version: ${{ matrix.node-version }}

- name: Install script dependencies
working-directory: .main-scripts/.github/scripts
working-directory: .github/scripts
run: npm install

- name: Run add-code-samples script
working-directory: .main-scripts/.github/scripts
run: npm run add-code-samples -- "../../.." "openapi.*\\.json"
working-directory: .github/scripts
run: npm run add-code-samples -- "../../openapi" "openapi.*\\.json"

- name: Run link replacement script
working-directory: .main-scripts/.github/scripts
run: npm run replace-links -- "../../.." "openapi.*\\.json" "https://developer.box.com/" "https://developer.box.com/ja/"
working-directory: .github/scripts
run: npm run replace-links -- "../../openapi" "openapi.*\\.json" "https://developer.box.com/" "https://developer.box.com/ja/"

- name: Cleanup working directory
run: rm -rf .main-scripts

- name: Push processed files to jp-api-docs branch
- name: Push openapi directory to jp-api-docs branch
uses: s0/git-publish-subdir-action@v2.6.0
env:
REPO: self
BRANCH: jp-api-docs
FOLDER: .
BRANCH: refs/heads/jp-api-docs
FOLDER: openapi
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MESSAGE: "Add SDK code samples and replace links for Japanese locale"

6 changes: 0 additions & 6 deletions .github/workflows/notify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,6 @@ jobs:
node-version: [24.x]

steps:
- name: "Trigger Netlify deployment"
uses: joelwmale/webhook-action@2.0.2
env:
WEBHOOK_URL: ${{ secrets.NETLIFY_BOXDEV_JP_WEBHOOK }}
data: "{}"

- name: Notify other repositories of update
uses: peter-evans/repository-dispatch@v1
with:
Expand Down