Repository: go-gorm/gorm
Pull request #6190 (2023-03-27 07:58:06)

chore(deps): bump actions/stale from 7 to 8
Bumps [actions/stale](https://github.com/actions/stale) from 7 to 8.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/actions/stale/releases">actions/stale's releases</a>.</em></p>
<blockquote>
<h2>v8.0.0</h2>
<p>:warning: This version contains breaking changes :warning:</p>
<h2>What's Changed</h2>
<ul>
<li>New option labels-to-remove-when-stale enables users to specify list of coma delimited labels that will be removed when the issue or PR becomes stale by <a href="https://github.com/panticmilos"><code>@​panticmilos</code></a> <a href="https://redirect.github.com/actions/stale/issues/770">actions/stale#770</a></li>
<li>Skip deleting the branch in the upstream of a forked repo by <a href="https://github.com/dsame"><code>@​dsame</code></a> <a href="https://redirect.github.com/actions/stale/pull/913">actions/stale#913</a></li>
<li>abort the build on the error by <a href="https://github.com/dsame"><code>@​dsame</code></a> in <a href="https://redirect.github.com/actions/stale/pull/935">actions/stale#935</a></li>
</ul>
<h2>Breaking Changes</h2>
<ul>
<li>In this release we prevent scenarios when the build is not interrupted on some exceptions, which led to successful builds when they are supposed to fail</li>
</ul>
<h2>Example</h2>
<pre lang="yaml"><code>name: 'Remove labels when the issue or PR becomes stale'
on:
  schedule:
    - cron: '30 1 * * *'
<p>permissions:
pull-request: write</p>
<p>jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v8
with:
labels-to-remove-when-stale: 'label1,label2'
</code></pre></p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/actions/stale/blob/main/CHANGELOG.md">actions/stale's changelog</a>.</em></p>
<blockquote>
<h1>Changelog</h1>
<h1>[7.0.0]</h1>
<p>:warning: Breaking change :warning:</p>
<ul>
<li>Allow daysBeforeStale options to be float by <a href="https://github.com/irega"><code>@​irega</code></a> in <a href="https://redirect.github.com/actions/stale/pull/841">actions/stale#841</a></li>
<li>Use cache in check-dist.yml by <a href="https://github.com/jongwooo"><code>@​jongwooo</code></a> in <a href="https://redirect.github.com/actions/stale/pull/876">actions/stale#876</a></li>
<li>fix print outputs step in existing workflows by <a href="https://github.com/irega"><code>@​irega</code></a> in <a href="https://redirect.github.com/actions/stale/pull/859">actions/stale#859</a></li>
<li>Update issue and PR templates, add/delete workflow files by <a href="https://github.com/IvanZosimov"><code>@​IvanZosimov</code></a> in <a href="https://redirect.github.com/actions/stale/pull/880">actions/stale#880</a></li>
<li>Update how stale handles exempt items by <a href="https://github.com/johnsudol"><code>@​johnsudol</code></a> in <a href="https://redirect.github.com/actions/stale/pull/874">actions/stale#874</a></li>
</ul>
<h1>[6.0.1]</h1>
<p>Update <code>@​actions/core</code> to v1.10.0 (<a href="https://redirect.github.com/actions/stale/pull/839">#839</a>)</p>
<h1>[6.0.0]</h1>
<p>:warning: Breaking change :warning:</p>
<p>Issues/PRs default <code>close-issue-reason</code> is now <code>not_planned</code>(<a href="https://redirect.github.com/actions/stale/issues/789">#789</a>)</p>
<h1>[5.1.0]</h1>
<p><a href="https://redirect.github.com/actions/stale/issues/696">Don't process stale issues right after they're marked stale</a>
[Add close-issue-reason option]<a href="https://redirect.github.com/actions/stale/pull/764">#764</a><a href="https://redirect.github.com/actions/stale/pull/772">#772</a>
Various dependabot/dependency updates</p>
<h2><a href="https://github.com/actions/stale/compare/v3.0.19...v4.1.0">4.1.0</a> (2021-07-14)</h2>
<h2>Features</h2>
<ul>
<li><a href="https://github.com/actions/stale/commit/9912fa74d1c01b5d6187793d97441019cbe325d0">Ability to exempt draft PRs</a></li>
</ul>
<h2><a href="https://github.com/actions/stale/compare/v3.0.19...v4.0.0">4.0.0</a> (2021-07-14)</h2>
<h3>Features</h3>
<ul>
<li><strong>options:</strong> simplify config by removing skip stale message options (<a href="https://redirect.github.com/actions/stale/issues/457">#457</a>) (<a href="https://github.com/actions/stale/commit/6ec637d238067ab8cc96c9289dcdac280bbd3f4a">6ec637d</a>), closes <a href="https://redirect.github.com/actions/stale/issues/405">#405</a> <a href="https://redirect.github.com/actions/stale/issues/455">#455</a></li>
<li><strong>output:</strong> print output parameters (<a href="https://redirect.github.com/actions/stale/issues/458">#458</a>) (<a href="https://github.com/actions/stale/commit/3e6d35b685f0b2fa1a69be893fa07d3d85e05ee0">3e6d35b</a>)</li>
</ul>
<h3>Bug Fixes</h3>
<ul>
<li><strong>dry-run:</strong> forbid mutations in dry-run (<a href="https://redirect.github.com/actions/stale/issues/500">#500</a>) (<a href="https://github.com/actions/stale/commit/f1017f33dd159ea51366375120c3e6981d7c3097">f1017f3</a>), closes <a href="https://redirect.github.com/actions/stale/issues/499">#499</a></li>
<li><strong>logs:</strong> coloured logs (<a href="https://redirect.github.com/actions/stale/issues/465">#465</a>) (<a href="https://github.com/actions/stale/commit/5fbbfba142860ea6512549e96e36e3540c314132">5fbbfba</a>)</li>
<li><strong>operations:</strong> fail fast the current batch to respect the operations limit (<a href="https://redirect.github.com/actions/stale/issues/474">#474</a>) (<a href="https://github.com/actions/stale/commit/5f6f311ca6aa75babadfc7bac6edf5d85fa3f35d">5f6f311</a>), closes <a href="https://redirect.github.com/actions/stale/issues/466">#466</a></li>
<li><strong>label comparison</strong>: make label comparison case insensitive <a href="https://redirect.github.com/actions/stale/pull/517">#517</a>, closes <a href="https://redirect.github.com/actions/stale/pull/516">#516</a></li>
<li><strong>filtering comments by actor could have strange behavior</strong>: &quot;stale&quot; comments are now detected based on if the message is the stale message not <em>who</em> made the comment(<a href="https://redirect.github.com/actions/stale/pull/519">#519</a>), fixes <a href="https://redirect.github.com/actions/stale/pull/441">#441</a>, <a href="https://redirect.github.com/actions/stale/pull/509">#509</a>, <a href="https://redirect.github.com/actions/stale/pull/518">#518</a></li>
</ul>
<h3>Breaking Changes</h3>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/actions/stale/commit/1160a2240286f5da8ec72b1c0816ce2481aabf84"><code>1160a22</code></a> Merge pull request <a href="https://redirect.github.com/actions/stale/issues/965">#965</a> from actions/dependabot/npm_and_yarn/prettier-2.8.6</li>
<li><a href="https://github.com/actions/stale/commit/5f7b3966457047e35f2989b4f3529d4fcbfd3bc8"><code>5f7b396</code></a> build(deps-dev): bump prettier from 2.8.4 to 2.8.6</li>
<li><a href="https://github.com/actions/stale/commit/b002e7ec857ceadb81a436f02fc2e21040190e0a"><code>b002e7e</code></a> Merge pull request <a href="https://redirect.github.com/actions/stale/issues/941">#941</a> from panticmilos/vmpantic/rebuild-dist-vercel-bump</li>
<li><a href="https://github.com/actions/stale/commit/52903732a4c3c9b1f232f1694ad0743bbfcef33c"><code>5290373</code></a> Rebuild dist after rebase</li>
<li><a href="https://github.com/actions/stale/commit/b006677dea6f2be4bde357abb1ccb22915272277"><code>b006677</code></a> Merge pull request <a href="https://redirect.github.com/actions/stale/issues/962">#962</a> from actions/dependabot/npm_and_yarn/jest-and-types/j...</li>
<li><a href="https://github.com/actions/stale/commit/4f29769aee0fc902940fb3af95c79e98e121683e"><code>4f29769</code></a> Merge pull request <a href="https://redirect.github.com/actions/stale/issues/961">#961</a> from actions/dependabot/npm_and_yarn/typescript-5.0.2</li>
<li><a href="https://github.com/actions/stale/commit/83453dd842477b1f93e2a366453b9d1c7540eb5b"><code>83453dd</code></a> build(deps-dev): bump jest and <code>@​types/jest</code></li>
<li><a href="https://github.com/actions/stale/commit/79e8c046ed3b9e6a6d89b0453d22c3a2eb50c90f"><code>79e8c04</code></a> Merge pull request <a href="https://redirect.github.com/actions/stale/issues/960">#960</a> from actions/dependabot/npm_and_yarn/types/node-18.15.3</li>
<li><a href="https://github.com/actions/stale/commit/75d4d955acb83847572798f2ffd26ba259871e3c"><code>75d4d95</code></a> Remove labels on stale (<a href="https://redirect.github.com/actions/stale/issues/959">#959</a>)</li>
<li><a href="https://github.com/actions/stale/commit/fac2d41a881555a987df3dacc701e84d898c2aa5"><code>fac2d41</code></a> build(deps-dev): bump typescript from 4.9.4 to 5.0.2</li>
<li>Additional commits viewable in <a href="https://github.com/actions/stale/compare/v7...v8">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=actions/stale&package-manager=github_actions&previous-version=7&new-version=8)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>


Patch:
diff --git a/.github/workflows/invalid_question.yml b/.github/workflows/invalid_question.yml
index 77b26ab..fbebfc1 100644
--- a/.github/workflows/invalid_question.yml
+++ b/.github/workflows/invalid_question.yml
@@ -16,7 +16,7 @@ jobs:
       ACTIONS_STEP_DEBUG: true
     steps:
     - name: Close Stale Issues
-      uses: actions/stale@v7
+      uses: actions/stale@v8
       with:
         repo-token: ${{ secrets.GITHUB_TOKEN }}
         stale-issue-message: "This issue has been marked as invalid question, please give more information by following the `Question` template, if you believe there is a bug of GORM, please create a pull request that could reproduce the issue on [https://github.com/go-gorm/playground](https://github.com/go-gorm/playground), the issue will be closed in 30 days if no further activity occurs. most likely your question already answered https://github.com/go-gorm/gorm/issues or described in the document https://gorm.io ✨ [Search Before Asking](https://stackoverflow.com/help/how-to-ask) ✨"
diff --git a/.github/workflows/missing_playground.yml b/.github/workflows/missing_playground.yml
index 1efa361..b23a5bf 100644
--- a/.github/workflows/missing_playground.yml
+++ b/.github/workflows/missing_playground.yml
@@ -16,7 +16,7 @@ jobs:
       ACTIONS_STEP_DEBUG: true
     steps:
     - name: Close Stale Issues
-      uses: actions/stale@v7
+      uses: actions/stale@v8
       with:
         repo-token: ${{ secrets.GITHUB_TOKEN }}
         stale-issue-message: "The issue has been automatically marked as stale as it missing playground pull request link, which is important to help others understand your issue effectively and make sure the issue hasn't been fixed on latest master, checkout [https://github.com/go-gorm/playground](https://github.com/go-gorm/playground) for details. it will be closed in 30 days if no further activity occurs. if you are asking question, please use the `Question` template, most likely your question already answered https://github.com/go-gorm/gorm/issues or described in the document https://gorm.io ✨ [Search Before Asking](https://stackoverflow.com/help/how-to-ask) ✨"
diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml
index 43f2f73..c975288 100644
--- a/.github/workflows/stale.yml
+++ b/.github/workflows/stale.yml
@@ -16,7 +16,7 @@ jobs:
       ACTIONS_STEP_DEBUG: true
     steps:
     - name: Close Stale Issues
-      uses: actions/stale@v7
+      uses: actions/stale@v8
       with:
         repo-token: ${{ secrets.GITHUB_TOKEN }}
         stale-issue-message: "This issue has been automatically marked as stale because it has been open 360 days with no activity. Remove stale label or comment or this will be closed in 180 days"
diff --git a/clause/limit.go b/clause/limit.go
index 3ede738..abda005 100644
--- a/clause/limit.go
+++ b/clause/limit.go
@@ -33,7 +33,7 @@ func (limit Limit) MergeClause(clause *Clause) {
 	clause.Name = ""
 
 	if v, ok := clause.Expression.(Limit); ok {
-		if (limit.Limit == nil || *limit.Limit == 0) && (v.Limit != nil && *v.Limit != 0) {
+		if (limit.Limit == nil || *limit.Limit == 0) && v.Limit != nil {
 			limit.Limit = v.Limit
 		}
 
diff --git a/schema/field.go b/schema/field.go
index 00beb06..15edab9 100644
--- a/schema/field.go
+++ b/schema/field.go
@@ -580,8 +580,6 @@ func (field *Field) setupValuerAndSetter() {
 			case **bool:
 				if data != nil && *data != nil {
 					field.ReflectValueOf(ctx, value).SetBool(**data)
-				} else {
-					field.ReflectValueOf(ctx, value).SetBool(false)
 				}
 			case bool:
 				field.ReflectValueOf(ctx, value).SetBool(data)
@@ -601,8 +599,6 @@ func (field *Field) setupValuerAndSetter() {
 			case **int64:
 				if data != nil && *data != nil {
 					field.ReflectValueOf(ctx, value).SetInt(**data)
-				} else {
-					field.ReflectValueOf(ctx, value).SetInt(0)
 				}
 			case int64:
 				field.ReflectValueOf(ctx, value).SetInt(data)
@@ -667,8 +663,6 @@ func (field *Field) setupValuerAndSetter() {
 			case **uint64:
 				if data != nil && *data != nil {
 					field.ReflectValueOf(ctx, value).SetUint(**data)
-				} else {
-					field.ReflectValueOf(ctx, value).SetUint(0)
 				}
 			case uint64:
 				field.ReflectValueOf(ctx, value).SetUint(data)
@@ -721,8 +715,6 @@ func (field *Field) setupValuerAndSetter() {
 			case **float64:
 				if data != nil && *data != nil {
 					field.ReflectValueOf(ctx, value).SetFloat(**data)
-				} else {
-					field.ReflectValueOf(ctx, value).SetFloat(0)
 				}
 			case float64:
 				field.ReflectValueOf(ctx, value).SetFloat(data)
@@ -767,8 +759,6 @@ func (field *Field) setupValuerAndSetter() {
 			case **string:
 				if data != nil && *data != nil {
 					field.ReflectValueOf(ctx, value).SetString(**data)
-				} else {
-					field.ReflectValueOf(ctx, value).SetString("")
 				}
 			case string:
 				field.ReflectValueOf(ctx, value).SetString(data)


Test patch:
diff --git a/clause/limit_test.go b/clause/limit_test.go
index 79065ab..a9fd4e2 100644
--- a/clause/limit_test.go
+++ b/clause/limit_test.go
@@ -28,6 +28,10 @@ func TestLimit(t *testing.T) {
 			[]clause.Interface{clause.Select{}, clause.From{}, clause.Limit{Limit: &limit0}},
 			"SELECT * FROM `users` LIMIT 0", nil,
 		},
+		{
+			[]clause.Interface{clause.Select{}, clause.From{}, clause.Limit{Limit: &limit0}, clause.Limit{Offset: 0}},
+			"SELECT * FROM `users` LIMIT 0", nil,
+		},
 		{
 			[]clause.Interface{clause.Select{}, clause.From{}, clause.Limit{Offset: 20}},
 			"SELECT * FROM `users` OFFSET 20", nil,
diff --git a/tests/embedded_struct_test.go b/tests/embedded_struct_test.go
index 63ec53e..0d240fd 100644
--- a/tests/embedded_struct_test.go
+++ b/tests/embedded_struct_test.go
@@ -103,9 +103,16 @@ func TestEmbeddedPointerTypeStruct(t *testing.T) {
 		URL   string
 	}
 
+	type Author struct {
+		ID    string
+		Name  string
+		Email string
+	}
+
 	type HNPost struct {
 		*BasePost
 		Upvotes int32
+		*Author `gorm:"EmbeddedPrefix:user_"` // Embedded struct
 	}
 
 	DB.Migrator().DropTable(&HNPost{})
@@ -123,6 +130,10 @@ func TestEmbeddedPointerTypeStruct(t *testing.T) {
 	if hnPost.Title != "embedded_pointer_type" {
 		t.Errorf("Should find correct value for embedded pointer type")
 	}
+
+	if hnPost.Author != nil {
+		t.Errorf("Expected to get back a nil Author but got: %v", hnPost.Author)
+	}
 }
 
 type Content struct {