You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-**New parameter**: `force_with_lease` for safer force pushing with `--force-with-lease`
@@ -10,9 +12,10 @@
10
12
11
13
A powerful GitHub Action for automatically committing and pushing changes back to your repository. Perfect for automation workflows and integrates seamlessly with [devops-infra/action-pull-request](https://github.com/devops-infra/action-pull-request).
| github_token | Yes | `""` | Personal Access Token for GitHub for pushing the code. |
65
-
| add_timestamp | No | `false` | Whether to add the timestamp to a new branch name. Uses format `%Y-%m-%dT%H-%M-%SZ`. |
66
-
| amend | No | `false` | Whether to make an amendment to the previous commit (`--amend`). Can be combined with `commit_message` to change the commit message. |
67
-
| commit_prefix | No | `""` | Prefix added to commit message. Combines with `commit_message`. |
68
-
| commit_message | No | `""` | Commit message to set. Combines with `commit_prefix`. Can be used with `amend` to change the commit message. |
69
-
| force | No | `false` | Whether to use force push (`--force`). Use only when you need to overwrite remote changes. Potentially dangerous. |
70
-
| force_with_lease | No | `false` | Whether to use force push with lease (`--force-with-lease`). Safer than `force` as it checks for remote changes. Set `fetch-depth: 0` for `actions/checkout`. |
71
-
| no_edit | No | `false` | Whether to not edit commit message when using amend (`--no-edit`). |
| github_token | Yes | `""` | Personal Access Token for GitHub for pushing the code. |
68
+
| add_timestamp | No | `false` | Whether to add the timestamp to a new branch name. Uses format `%Y-%m-%dT%H-%M-%SZ`. |
69
+
| amend | No | `false` | Whether to make an amendment to the previous commit (`--amend`). Can be combined with `commit_message` to change the commit message. |
70
+
| commit_prefix | No | `""` | Prefix added to commit message. Combines with `commit_message`. |
71
+
| commit_message | No | `""` | Commit message to set. Combines with `commit_prefix`. Can be used with `amend` to change the commit message. |
72
+
| force | No | `false` | Whether to use force push (`--force`). Use only when you need to overwrite remote changes. Potentially dangerous. |
73
+
| force_with_lease | No | `false` | Whether to use force push with lease (`--force-with-lease`). Safer than `force` as it checks for remote changes. Set `fetch-depth: 0` for `actions/checkout`. |
74
+
| no_edit | No | `false` | Whether to not edit commit message when using amend (`--no-edit`). |
- **`vX.Y.Z`**: Fixed to a specific release (e.g., `v1.2.3`).
217
+
_Benefit: Full reproducibility—never changes._
220
218
221
-
Uses a specific version. More predictable but requires manual updates.
219
+
**Use the tag depth that matches your stability needs.**
222
220
223
221
224
222
## ⚠️ Force Push Options
225
223
226
224
This action provides two force push options for different scenarios:
227
225
226
+
228
227
### 🛡️ `force_with_lease` (Recommended)
229
228
- Uses `git push --force-with-lease`
230
229
- **Safer option** that checks if someone else has pushed changes to the remote branch
231
230
- Prevents accidentally overwriting other people's work
232
231
- **Required:** Set `fetch-depth: 0` in your `actions/checkout` step
233
232
- **Use case:** Amending commits, rebasing, or other history modifications
234
233
234
+
235
235
### ⚡ `force` (Use with Caution)
236
236
- Uses `git push --force`
237
237
- **Potentially dangerous** as it will overwrite remote changes unconditionally
@@ -243,7 +243,7 @@ This action provides two force push options for different scenarios:
243
243
244
244
## 🤝 Contributing
245
245
246
-
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
246
+
Contributions are welcome! Please feel free to submit a Pull Request. Refer to the [CONTRIBUTING](https://github.com/devops-infra/.github/blob/master/CONTRIBUTING.md) for guidelines.
247
247
248
248
249
249
## 📄 License
@@ -259,6 +259,5 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
259
259
## 💬 Support
260
260
261
261
If you have any questions or need help, please:
262
-
- 📝 Create an [issue](https://github.com/devops-infra/action-commit-push/issues)
263
-
- 💬 Start a [discussion](https://github.com/devops-infra/action-commit-push/discussions)
262
+
- 📝 Create an [issue](https://github.com/devops-infra/template-action/issues)
0 commit comments