Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: use delimiter in accorance with docs to handle strings with newlines in snapshot release action #11741

Conversation

alessbell
Copy link
Contributor

Fixes failing snapshot release action with multiple changesets, see https://github.com/apollographql/apollo-client/actions/runs/8510609697/job/23308544668.

See https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#multiline-strings for docs on using mutli-line strings with GITHUB_OUTPUT GHA env variable.

@alessbell alessbell requested a review from jerelmiller April 1, 2024 16:48
Copy link

changeset-bot bot commented Apr 1, 2024

⚠️ No Changeset found

Latest commit: 3b980e7

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

github-actions bot commented Apr 1, 2024

size-limit report 📦

Path Size
dist/apollo-client.min.cjs 38.4 KB (0%)
import { ApolloClient, InMemoryCache, HttpLink } from "dist/main.cjs" 46.23 KB (0%)
import { ApolloClient, InMemoryCache, HttpLink } from "dist/main.cjs" (production) 43.79 KB (0%)
import { ApolloClient, InMemoryCache, HttpLink } from "dist/index.js" 33.96 KB (0%)
import { ApolloClient, InMemoryCache, HttpLink } from "dist/index.js" (production) 31.87 KB (0%)
import { ApolloProvider } from "dist/react/index.js" 1.23 KB (0%)
import { ApolloProvider } from "dist/react/index.js" (production) 1.22 KB (0%)
import { useQuery } from "dist/react/index.js" 5.26 KB (0%)
import { useQuery } from "dist/react/index.js" (production) 4.35 KB (0%)
import { useLazyQuery } from "dist/react/index.js" 5.5 KB (0%)
import { useLazyQuery } from "dist/react/index.js" (production) 4.58 KB (0%)
import { useMutation } from "dist/react/index.js" 3.51 KB (0%)
import { useMutation } from "dist/react/index.js" (production) 2.73 KB (0%)
import { useSubscription } from "dist/react/index.js" 3.19 KB (0%)
import { useSubscription } from "dist/react/index.js" (production) 2.38 KB (0%)
import { useSuspenseQuery } from "dist/react/index.js" 5.41 KB (0%)
import { useSuspenseQuery } from "dist/react/index.js" (production) 4.07 KB (0%)
import { useBackgroundQuery } from "dist/react/index.js" 4.89 KB (0%)
import { useBackgroundQuery } from "dist/react/index.js" (production) 3.55 KB (0%)
import { useLoadableQuery } from "dist/react/index.js" 5.02 KB (0%)
import { useLoadableQuery } from "dist/react/index.js" (production) 3.68 KB (0%)
import { useReadQuery } from "dist/react/index.js" 3.17 KB (0%)
import { useReadQuery } from "dist/react/index.js" (production) 3.11 KB (0%)
import { useFragment } from "dist/react/index.js" 2.27 KB (0%)
import { useFragment } from "dist/react/index.js" (production) 2.22 KB (0%)

Copy link
Member

@jerelmiller jerelmiller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just had a question about the variable used for GITHUB_OUTPUT but otherwise looks great. Thanks for hopping in this so fast!

delimiter="$(openssl rand -hex 8)"
echo "changesets<<${delimiter}" >> "${GITHUB_OUTPUT}"
echo "$(git diff --name-only --diff-filter=A ${{ steps.comment-branch.outputs.base_sha }} ${{ steps.comment-branch.outputs.head_sha }} .changeset/*.md)" >> "${GITHUB_OUTPUT}"
echo "${delimiter}" >> "${GITHUB_OUTPUT}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to confirm, is the ${GITHUB_OUTPUT} format correct? I'm seeing $GITHUB_OUTPUT in those docs, but maybe I'm missing context here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops! Sorry I missed this before. We could do without curly braces here, but syntactically they're fine to include (e.g. if we wanted to expand the variable foo in a string it would be "${foo}bar" whereas "$foobar" would expand the variable foobar).

@github-actions github-actions bot added the auto-cleanup 🤖 label Apr 1, 2024
@alessbell alessbell merged commit 26f2ccc into main Apr 1, 2024
37 checks passed
@alessbell alessbell deleted the handle-multiline-strings-with-GITHUB_OUTPUT-in-snapshot-releases branch April 1, 2024 17:11
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants