From 28ac83f3e6fe9fa8f39c6aa46e5dfa1c1fe9cf15 Mon Sep 17 00:00:00 2001 From: Adam Jenkins Date: Sun, 1 Feb 2026 12:17:57 -0400 Subject: [PATCH 1/4] Add idp_attributes field to OrganizationMembership - Add :idp_attributes to attr_accessor - Initialize @idp_attributes with default empty hash - Include idp_attributes in to_json output This change adds support for IDP custom attributes on organization memberships, which are sourced from the identity provider and stored as customAttributes in the API. Related to workos/workos PR #50470 Co-Authored-By: Claude Sonnet 4.5 --- lib/workos/organization_membership.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/workos/organization_membership.rb b/lib/workos/organization_membership.rb index 4943b5ad..ea826e07 100644 --- a/lib/workos/organization_membership.rb +++ b/lib/workos/organization_membership.rb @@ -7,7 +7,7 @@ module WorkOS class OrganizationMembership include HashProvider - attr_accessor :id, :user_id, :organization_id, :status, :role, :roles, :created_at, :updated_at + attr_accessor :id, :user_id, :organization_id, :status, :role, :roles, :idp_attributes, :created_at, :updated_at def initialize(json) hash = JSON.parse(json, symbolize_names: true) @@ -18,6 +18,7 @@ def initialize(json) @status = hash[:status] @role = hash[:role] @roles = hash[:roles] + @idp_attributes = hash[:idp_attributes] || {} @created_at = hash[:created_at] @updated_at = hash[:updated_at] end @@ -30,6 +31,7 @@ def to_json(*) status: status, role: role, roles: roles, + idp_attributes: idp_attributes, created_at: created_at, updated_at: updated_at, } From 0046ed8ce3e6b6cc5f15c06e50d549d50bc968b5 Mon Sep 17 00:00:00 2001 From: Adam Jenkins Date: Sun, 1 Feb 2026 12:55:50 -0400 Subject: [PATCH 2/4] Remove default empty hash for idp_attributes to match codebase convention API guarantees idp_attributes is always present, so no default needed. --- lib/workos/organization_membership.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/workos/organization_membership.rb b/lib/workos/organization_membership.rb index ea826e07..53ed17ea 100644 --- a/lib/workos/organization_membership.rb +++ b/lib/workos/organization_membership.rb @@ -18,7 +18,7 @@ def initialize(json) @status = hash[:status] @role = hash[:role] @roles = hash[:roles] - @idp_attributes = hash[:idp_attributes] || {} + @idp_attributes = hash[:idp_attributes] @created_at = hash[:created_at] @updated_at = hash[:updated_at] end From c6ca37f2894cbbf5835360568a841b2f2ac3739e Mon Sep 17 00:00:00 2001 From: Adam Jenkins Date: Sun, 1 Feb 2026 20:05:41 -0400 Subject: [PATCH 3/4] Rename idp_attributes to custom_attributes --- lib/workos/organization_membership.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/workos/organization_membership.rb b/lib/workos/organization_membership.rb index 53ed17ea..8c8dcfb2 100644 --- a/lib/workos/organization_membership.rb +++ b/lib/workos/organization_membership.rb @@ -7,7 +7,7 @@ module WorkOS class OrganizationMembership include HashProvider - attr_accessor :id, :user_id, :organization_id, :status, :role, :roles, :idp_attributes, :created_at, :updated_at + attr_accessor :id, :user_id, :organization_id, :status, :role, :roles, :custom_attributes, :created_at, :updated_at def initialize(json) hash = JSON.parse(json, symbolize_names: true) @@ -18,7 +18,7 @@ def initialize(json) @status = hash[:status] @role = hash[:role] @roles = hash[:roles] - @idp_attributes = hash[:idp_attributes] + @custom_attributes = hash[:custom_attributes] @created_at = hash[:created_at] @updated_at = hash[:updated_at] end @@ -31,7 +31,7 @@ def to_json(*) status: status, role: role, roles: roles, - idp_attributes: idp_attributes, + custom_attributes: custom_attributes, created_at: created_at, updated_at: updated_at, } From be3027b25846d5aa774ed0f837794366c64bbdba Mon Sep 17 00:00:00 2001 From: "Garen J. Torikian" Date: Mon, 2 Feb 2026 14:09:40 -0500 Subject: [PATCH 4/4] Add release workflow automation --- .github/workflows/release.yml | 77 ++++++++++++++++++---------- .github/workflows/version-bump.yml | 80 ++++++++++++++++++++++++++++++ 2 files changed, 132 insertions(+), 25 deletions(-) create mode 100644 .github/workflows/version-bump.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f38bfe56..582ca8f1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,43 +1,70 @@ name: Release on: - # Support manually pushing a new release - workflow_dispatch: {} - # Trigger when a release is published - release: - types: [released] + pull_request: + types: [closed] + branches: [main] defaults: run: shell: bash jobs: - test: - name: Publish to RubyGems + create-release: + name: Create GitHub Release + if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'version-bump') runs-on: ubuntu-latest + permissions: + contents: write steps: - - uses: actions/checkout@v6 - - uses: ruby/setup-ruby@v1 + - name: Generate token + id: generate-token + uses: actions/create-github-app-token@v1 with: - ruby-version: '3.2' - bundler-cache: true + app-id: ${{ vars.SDK_BOT_APP_ID }} + private-key: ${{ secrets.SDK_BOT_PRIVATE_KEY }} - - name: Spec - run: | - bundle exec rspec + - name: Checkout + uses: actions/checkout@v4 + with: + token: ${{ steps.generate-token.outputs.token }} - - name: Publish - env: - RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }} + - name: Get version from version.rb + id: get-version run: | - mkdir -p ~/.gem + VERSION=$(grep "VERSION = " lib/workos/version.rb | sed "s/.*VERSION = '\(.*\)'/\1/") + echo "version=$VERSION" >> $GITHUB_OUTPUT + + - name: Create Release + uses: softprops/action-gh-release@v2 + with: + tag_name: v${{ steps.get-version.outputs.version }} + name: v${{ steps.get-version.outputs.version }} + generate_release_notes: true + token: ${{ steps.generate-token.outputs.token }} + + publish: + name: Publish to RubyGems + needs: create-release + runs-on: ubuntu-latest + permissions: + id-token: write + contents: read + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: "3.2" + bundler-cache: true - cat << EOF > ~/.gem/credentials - --- - :rubygems_api_key: ${RUBYGEMS_API_KEY} - EOF + - name: Run tests + run: bundle exec rspec - chmod 0600 ~/.gem/credentials + - name: Build gem + run: gem build workos.gemspec - bundle exec gem build workos --output=release.gem - bundle exec gem push release.gem + - name: Publish to RubyGems + uses: rubygems/release-gem@v1 diff --git a/.github/workflows/version-bump.yml b/.github/workflows/version-bump.yml new file mode 100644 index 00000000..4793399f --- /dev/null +++ b/.github/workflows/version-bump.yml @@ -0,0 +1,80 @@ +name: Version Bump + +on: + workflow_dispatch: + inputs: + bump_type: + description: "Version bump type" + required: true + type: choice + options: + - patch + - minor + - major + +jobs: + bump-version: + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + steps: + - name: Generate token + id: generate-token + uses: actions/create-github-app-token@v1 + with: + app-id: ${{ vars.SDK_BOT_APP_ID }} + private-key: ${{ secrets.SDK_BOT_PRIVATE_KEY }} + + - name: Checkout + uses: actions/checkout@v4 + with: + token: ${{ steps.generate-token.outputs.token }} + + - name: Configure Git + run: | + git config user.name "workos-bot[bot]" + git config user.email "workos-bot[bot]@users.noreply.github.com" + + - name: Read current version + id: current-version + run: | + CURRENT_VERSION=$(grep "VERSION = " lib/workos/version.rb | sed "s/.*VERSION = '\(.*\)'/\1/") + echo "version=$CURRENT_VERSION" >> $GITHUB_OUTPUT + + - name: Bump version + id: bump-version + run: | + CURRENT_VERSION="${{ steps.current-version.outputs.version }}" + IFS='.' read -r MAJOR MINOR PATCH <<< "$CURRENT_VERSION" + + case "${{ github.event.inputs.bump_type }}" in + major) + NEW_VERSION="$((MAJOR + 1)).0.0" + ;; + minor) + NEW_VERSION="$MAJOR.$((MINOR + 1)).0" + ;; + patch) + NEW_VERSION="$MAJOR.$MINOR.$((PATCH + 1))" + ;; + esac + + echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT + + - name: Update version in version.rb + run: | + sed -i "s/VERSION = '.*'/VERSION = '${{ steps.bump-version.outputs.new_version }}'/" lib/workos/version.rb + + - name: Create Pull Request + uses: peter-evans/create-pull-request@v7 + with: + token: ${{ steps.generate-token.outputs.token }} + commit-message: "v${{ steps.bump-version.outputs.new_version }}" + title: "v${{ steps.bump-version.outputs.new_version }}" + body: | + Bumps version from ${{ steps.current-version.outputs.version }} to ${{ steps.bump-version.outputs.new_version }}. + + This PR was automatically created by the version-bump workflow. + branch: version-bump-${{ steps.bump-version.outputs.new_version }} + labels: version-bump