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
16 changes: 15 additions & 1 deletion .github/workflows/commit-changes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,27 @@ on:
required: true
type: string
description: 'File patterns to add (space-separated)'
secrets:
APP_ID:
required: true
description: 'GitHub App ID'
APP_PRIVATE_KEY:
required: true
description: 'GitHub App private key'

jobs:
commit:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Generate App Token
id: app-token
uses: actions/create-github-app-token@v2
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}

- name: Configure Git
run: |
git config --global user.name 'github-actions[bot]'
Expand Down Expand Up @@ -49,4 +63,4 @@ jobs:
# Push the changes
git push origin $BRANCH_NAME
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
12 changes: 10 additions & 2 deletions .github/workflows/generate-code-samples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,24 @@ jobs:
runs-on: macos-latest

steps:
- name: Generate App Token
id: app-token
uses: actions/create-github-app-token@v2
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}

- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ steps.app-token.outputs.token }}

- name: Set up mise
uses: jdx/mise-action@v2
with:
cache: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}

- name: Install dependencies
run: pnpm install --frozen-lockfile
Expand Down Expand Up @@ -67,4 +75,4 @@ jobs:
with:
commit_message: 'Update code samples'
file_patterns: 'merged_code_samples_specs/* modified_code_samples_specs/* final_specs/* .speakeasy/*'
github_token: ${{ secrets.GITHUB_TOKEN }}
github_token: ${{ steps.app-token.outputs.token }}
9 changes: 8 additions & 1 deletion .github/workflows/openapi-diff-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Generate App Token
id: app-token
uses: actions/create-github-app-token@v2
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}

- name: Checkout repository
uses: actions/checkout@v4

Expand All @@ -26,7 +33,7 @@ jobs:
with:
cache: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}

- name: Install dependencies
run: pnpm install --frozen-lockfile --ignore-scripts
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,21 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Generate App Token
id: app-token
uses: actions/create-github-app-token@v2
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}

- uses: actions/checkout@v4

- name: Set up mise
uses: jdx/mise-action@v2
with:
cache: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}

- name: Install dependencies
run: pnpm install --frozen-lockfile
Expand Down
12 changes: 10 additions & 2 deletions .github/workflows/transform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,24 @@ jobs:
transform:
runs-on: ubuntu-latest
steps:
- name: Generate App Token
id: app-token
uses: actions/create-github-app-token@v2
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}

- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ steps.app-token.outputs.token }}

- name: Set up mise
uses: jdx/mise-action@v2
with:
cache: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}

- name: Install dependencies
run: pnpm install --frozen-lockfile --ignore-scripts
Expand Down Expand Up @@ -124,4 +132,4 @@ jobs:

Generated-by: .github/workflows/transform.yml
file_patterns: 'generated_specs/* .speakeasy/* overlayed_specs/*'
github_token: ${{ secrets.GITHUB_TOKEN }}
github_token: ${{ steps.app-token.outputs.token }}
17 changes: 13 additions & 4 deletions .github/workflows/trigger-client-generation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,19 @@ jobs:
if: needs.check.outputs.should_trigger == 'true'

steps:
- name: Generate App Token
id: app-token
uses: actions/create-github-app-token@v2
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
owner: gleanwork
repositories: api-client-python,api-client-typescript,api-client-go,api-client-java

- name: Trigger Python Client SDK Generation
uses: actions/github-script@v7
with:
github-token: ${{ secrets.CLIENT_GENERATION_TOKEN }}
github-token: ${{ steps.app-token.outputs.token }}
script: |
const result = await github.rest.actions.createWorkflowDispatch({
owner: 'gleanwork',
Expand All @@ -84,7 +93,7 @@ jobs:
- name: Trigger TypeScript Client SDK Generation
uses: actions/github-script@v7
with:
github-token: ${{ secrets.CLIENT_GENERATION_TOKEN }}
github-token: ${{ steps.app-token.outputs.token }}
script: |
const result = await github.rest.actions.createWorkflowDispatch({
owner: 'gleanwork',
Expand All @@ -98,7 +107,7 @@ jobs:
- name: Trigger Go Client SDK Generation
uses: actions/github-script@v7
with:
github-token: ${{ secrets.CLIENT_GENERATION_TOKEN }}
github-token: ${{ steps.app-token.outputs.token }}
script: |
const result = await github.rest.actions.createWorkflowDispatch({
owner: 'gleanwork',
Expand All @@ -112,7 +121,7 @@ jobs:
- name: Trigger Java Client SDK Generation
uses: actions/github-script@v7
with:
github-token: ${{ secrets.CLIENT_GENERATION_TOKEN }}
github-token: ${{ steps.app-token.outputs.token }}
script: |
const result = await github.rest.actions.createWorkflowDispatch({
owner: 'gleanwork',
Expand Down
11 changes: 10 additions & 1 deletion .github/workflows/trigger-developer-site-redeploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,19 @@ jobs:
echo "Automatically triggered after successful Deploy Specs to GitHub Pages workflow"
fi

- name: Generate App Token
id: app-token
uses: actions/create-github-app-token@v2
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
owner: gleanwork
repositories: glean-developer-site

- name: Trigger Developer Site Redeploy
uses: actions/github-script@v7
with:
github-token: ${{ secrets.DEVELOPER_SITE_REDEPLOY_TOKEN }}
github-token: ${{ steps.app-token.outputs.token }}
script: |
const reason = '${{ github.event.inputs.reason }}' || "Triggered by OpenAPI specs deployment";
const result = await github.rest.actions.createWorkflowDispatch({
Expand Down