Repository: styled-components/babel-plugin-styled-components
Pull request #383 (2023-02-18 17:55:02)

bump codeql GH Action to v2
According to warning:

```
This version of the CodeQL Action was deprecated on January 18th, 2023, and is no longer updated or supported. For better performance, improved security, and new features, upgrade to v2. For more information, see https://github.blog/changelog/2023-01-18-code-scanning-codeql-action-v1-is-now-deprecated/
```

Need to bump CodeQL GH Action to the latest version.


Patch:
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
index 34af3cf..86c249d 100644
--- a/.github/workflows/codeql-analysis.yml
+++ b/.github/workflows/codeql-analysis.yml
@@ -43,7 +43,7 @@ jobs:
 
     # Initializes the CodeQL tools for scanning.
     - name: Initialize CodeQL
-      uses: github/codeql-action/init@v1
+      uses: github/codeql-action/init@v2
       with:
         languages: ${{ matrix.language }}
         # If you wish to specify custom queries, you can do so here or in a config file.
@@ -54,7 +54,7 @@ jobs:
     # Autobuild attempts to build any compiled languages  (C/C++, C#, or Java).
     # If this step fails, then you should remove it and run the build manually (see below)
     - name: Autobuild
-      uses: github/codeql-action/autobuild@v1
+      uses: github/codeql-action/autobuild@v2
 
     # ℹ️ Command-line programs to run using the OS shell.
     # 📚 https://git.io/JvXDl
@@ -68,4 +68,4 @@ jobs:
     #   make release
 
     - name: Perform CodeQL Analysis
-      uses: github/codeql-action/analyze@v1
+      uses: github/codeql-action/analyze@v2
diff --git a/src/visitors/transpileCssProp.js b/src/visitors/transpileCssProp.js
index 930fcf4..2c5b057 100644
--- a/src/visitors/transpileCssProp.js
+++ b/src/visitors/transpileCssProp.js
@@ -163,6 +163,7 @@ export default t => (path, state) => {
             ? property.key.name !== property.value.name
             : true) &&
           // and not a tricky expression
+          !t.isMemberExpression(property.value) &&
           !t.isLogicalExpression(property.value) &&
           !t.isConditionalExpression(property.value))
       ) {


Test patch:
diff --git a/test/fixtures/transpile-css-prop/code.js b/test/fixtures/transpile-css-prop/code.js
index 755c436..1a4ed2c 100644
--- a/test/fixtures/transpile-css-prop/code.js
+++ b/test/fixtures/transpile-css-prop/code.js
@@ -233,6 +233,21 @@ const ObjectInterpolationLogical = ({ bg, content, height, width, ...p }) => {
   )
 }
 
+const ObjectInterpolationMember = p => {
+  const theme = useTheme()
+  const color = 'red'
+
+  return (
+    <p
+      css={{
+        color: theme.colors[color],
+      }}
+    >
+      H
+    </p>
+  )
+}
+
 const RenderPropComponentCSSProp = () => {
   return (
     <RenderPropComponent>
diff --git a/test/fixtures/transpile-css-prop/output.js b/test/fixtures/transpile-css-prop/output.js
index 339ef75..f3ad67c 100644
--- a/test/fixtures/transpile-css-prop/output.js
+++ b/test/fixtures/transpile-css-prop/output.js
@@ -206,6 +206,14 @@ var ObjectInterpolationLogical = function ObjectInterpolationLogical(_ref4) {
     </_StyledP14>;
 };
 
+var ObjectInterpolationMember = function ObjectInterpolationMember(p) {
+  var theme = useTheme();
+  var color = 'red';
+  return <_StyledP15 $_css19={theme.colors[color]}>
+      H
+    </_StyledP15>;
+};
+
 var RenderPropComponentCSSProp = function RenderPropComponentCSSProp() {
   return <RenderPropComponent>
       {function () {
@@ -309,6 +317,12 @@ var _StyledP14 = (0, _styledComponents["default"])("p")(function (p) {
   };
 });
 
+var _StyledP15 = (0, _styledComponents["default"])("p")(function (p) {
+  return {
+    color: p.$_css19
+  };
+});
+
 var _StyledDiv2 = (0, _styledComponents["default"])("div")(_templateObject18 || (_templateObject18 = _taggedTemplateLiteral(["\n            color: black;\n          "])));
 
 var _StyledDiv3 = (0, _styledComponents["default"])("div")(_templateObject19 || (_templateObject19 = _taggedTemplateLiteral(["\n            color: black;\n          "])));