Skip to content

Commit

Permalink
fix: improve ownership change handling (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
antonbaliasnikov authored Dec 6, 2024
1 parent 937dcf1 commit 3d4764f
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions .github/workflows/release-plz.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,6 @@ jobs:
with:
toolchain: ${{ inputs.rust-toolchain }}

- name: Install cargo workspaces
shell: 'bash -ex {0}'
if: ${{ inputs.org-owner != '' }}
run: cargo install cargo-workspaces

- name: Build the workspace before release
shell: 'bash -ex {0}'
if: ${{ inputs.run_build == true || inputs.run_build == 'true' }}
Expand All @@ -83,6 +78,7 @@ jobs:

- name: Run release-plz
uses: release-plz/[email protected]
id: release-plz
with:
command: release
manifest_path: ${{ inputs.manifest_path }}
Expand All @@ -93,12 +89,12 @@ jobs:

- name: Update ownership
shell: 'bash -ex {0}'
if: ${{ inputs.org-owner != '' }}
if: ${{ steps.release-plz.outputs.releases_created && inputs.org-owner != '' }}
run: |
cd $(dirname ${{ inputs.manifest_path }})
ORG_OWNER=${{ inputs.org-owner }}
cargo login ${{ secrets.cargo_registry_token }}
for PKG in $(cargo ws list); do
for PKG in $(echo "${{ steps.release-plz.outputs.releases }}" | jq -r '.[].package_name'); do
cargo owner --list --quiet ${PKG} | grep ${ORG_OWNER} || cargo owner --add ${ORG_OWNER} ${PKG}
done
Expand Down

0 comments on commit 3d4764f

Please sign in to comment.