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
29 changes: 29 additions & 0 deletions .github/workflows/python-sdk.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Release Python SDK

on:
workflow_dispatch:
inputs:
version:
description: "The version of the SDK that you would like to release"
required: true
type: string

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3

- name: Setup node
uses: actions/setup-node@v4

- name: Download Fern
run: npm install -g fern-api

- name: Release SDKs
env:
FERN_TOKEN: ${{ secrets.FERN_TOKEN }}
FERN_PYPI_TOKEN: ${{ secrets.FERN_PYPI_TOKEN }}
run: |
fern generate --group python-sdk --version ${{ inputs.version }} --log-level debug
Comment on lines +13 to +29

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

Copilot Autofix

AI 6 months ago

The best way to fix this issue is to introduce an explicit permissions block at the root of the workflow file. This block will define minimal permissions required for the workflow to function correctly. Based on the workflow's operations, it likely only requires contents: read permission for accessing the repository's code. If additional permissions are required (e.g., pull-requests: write), they can be added accordingly.

To implement the fix:

  • Add a permissions key at the root level of the workflow file (before jobs).
  • Set the permissions to contents: read, as this workflow primarily interacts with the repository's contents.

Suggested changeset 1
.github/workflows/python-sdk.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/python-sdk.yml b/.github/workflows/python-sdk.yml
--- a/.github/workflows/python-sdk.yml
+++ b/.github/workflows/python-sdk.yml
@@ -1,5 +1,8 @@
 name: Release Python SDK
 
+permissions:
+  contents: read
+
 on:
   workflow_dispatch:
     inputs:
EOF
@@ -1,5 +1,8 @@
name: Release Python SDK

permissions:
contents: read

on:
workflow_dispatch:
inputs:
Copilot is powered by AI and may make mistakes. Always verify output.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ compiled/

# Rubymine
.idea

# Fern preview files
/fern/.preview
17 changes: 17 additions & 0 deletions fern/generators.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,20 @@ groups:
client-class-name: Intercom
inline-path-parameters: true
enable-forward-compatible-enums: true

python-sdk:
generators:
- name: fernapi/fern-python-sdk
version: 4.22.0
github:
mode: pull-request
repository: intercom/intercom-python
config:
client_class_name: Intercom
pydantic_config:
skip_validation: true
output:
location: pypi
package-name: 'intercom-python'
token: ${FERN_PYPI_TOKEN}