1717
1818 steps :
1919 # Create/update release PR
20- - uses : googleapis /release-please-action@v4
20+ - uses : google-github-actions /release-please-action@v4
2121 id : release
2222 with :
2323 # These are the necessary parameters for releasing multiple packages
@@ -27,10 +27,32 @@ jobs:
2727 manifest-file : .release-please-manifest.json
2828 monorepo-tags : true
2929
30+ - name : Compute tag name
31+ id : compute
32+ if : steps.release.outputs.releases_created
33+ run : |
34+ # For a monorepo, there may be multiple tags, so outputs.tag_name is
35+ # only used for releases of the root component. To get the tag name
36+ # generally, we need to check outputs.paths_released, and possibly
37+ # use that to construct the tag name. This seems like a major
38+ # failing of release-please-action, which could have a simple output
39+ # with an arbitrary tag name for situations like this.
40+ json="${{ toJSON(steps.release.outputs) }}"
41+ # This is a tag from the root component, if any.
42+ tag_name=$(echo "$json" | jq -r .tag_name)
43+ if [[ "$tag_name" == "" ]]; then
44+ # We don't care about every single tag. We just care about one tag
45+ # so we can check out the appropriate code from the repo. So grab
46+ # path [0].
47+ path=$(echo "$json" | jq -r .paths_released[0])
48+ tag_name=$(echo "$json" | jq -r ".$path--tag_name")
49+ fi
50+ echo "tag_name=$tag_name" >> $GITHUB_OUTPUT
51+
3052 - name : Checkout code
3153 uses : actions/checkout@v4
3254 with :
33- ref : refs/tags/${{ steps.release .outputs.tag_name }}
55+ ref : refs/tags/${{ steps.compute .outputs.tag_name }}
3456 persist-credentials : false
3557 if : steps.release.outputs.releases_created
3658
0 commit comments