-
-
Notifications
You must be signed in to change notification settings - Fork 0
Feature/GitHub releases documentation #11
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| # 🛡️ Branch Protection Conflict - Lösung | ||
|
|
||
| ## 🚨 Problem | ||
| ``` | ||
| remote: error: GH013: Repository rule violations found for refs/heads/main | ||
| remote: - Changes must be made through a pull request | ||
| remote: - 4 of 4 required status checks are expected | ||
| ``` | ||
|
|
||
| ## ✅ Das ist KORREKT! | ||
|
|
||
| **Dies ist kein Fehler, sondern ein Erfolg!** 🎉 | ||
|
|
||
| Die Branch Protection Rules funktionieren wie gewünscht: | ||
| - ✅ Direkte Pushes auf `main` sind blockiert | ||
| - ✅ Pull Requests sind erforderlich | ||
| - ✅ Status Checks laufen | ||
| - ✅ Code Scanning ist aktiv | ||
|
|
||
| ## 🎯 Was passiert ist | ||
|
|
||
| 1. **Merge-Commit erkannt** ✓ | ||
| 2. **Version berechnet**: v1.11.0 ✓ | ||
| 3. **Release-Prozess gestartet** ✓ | ||
| 4. **Branch Protection blockiert Push** ✓ (Gewünscht!) | ||
|
|
||
| ## 🔧 Lösungsoptionen | ||
|
|
||
| ### Option 1: GitHub App Token (Professionell) | ||
| ```yaml | ||
| - uses: tibdex/github-app-token@v1 | ||
| with: | ||
| app_id: ${{ secrets.APP_ID }} | ||
| private_key: ${{ secrets.PRIVATE_KEY }} | ||
| ``` | ||
|
|
||
| ### Option 2: Release ohne main-Push (Empfohlen) | ||
| Der Workflow sollte **nur Tags und Releases** erstellen, nicht auf `main` pushen: | ||
|
|
||
| ```yaml | ||
| - name: Create Release | ||
| uses: softprops/action-gh-release@v1 | ||
| with: | ||
| tag_name: v${{ steps.version.outputs.new_version }} | ||
| name: Release v${{ steps.version.outputs.new_version }} | ||
| generate_release_notes: true | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| ``` | ||
|
|
||
| ### Option 3: Admin Override (Temporär) | ||
| Für Admins: Branch Protection temporär für Service-Accounts aussetzen. | ||
|
|
||
| ## 🎯 Empfohlene Lösung | ||
|
|
||
| **Workflow anpassen** - Kein direkter Push auf `main` nötig: | ||
|
|
||
| 1. **Tag erstellen** ✓ | ||
| 2. **Release erstellen** ✓ | ||
| 3. **Assets hochladen** ✓ | ||
| 4. **PyPI publish** ✓ | ||
| 5. **Packages publish** ✓ | ||
|
|
||
| **Ohne** main-Branch zu berühren! | ||
|
|
||
| ## 📋 Nächste Schritte | ||
|
|
||
| 1. **Workflow anpassen** - Entferne `git push origin main` | ||
| 2. **Nur Tags/Releases** - Verwende GitHub API | ||
| 3. **Branch Protection beibehalten** - Für Sicherheit | ||
|
|
||
| ## ✨ Warum das gut ist | ||
|
|
||
| - 🛡️ **Sicherheit**: Kein direkter main-Push möglich | ||
| - 🔄 **Workflow**: Alle Änderungen über PRs | ||
| - 🧪 **Testing**: Status Checks vor jedem Merge | ||
| - 📝 **Review**: Code Review für alle Änderungen | ||
|
|
||
| --- | ||
|
|
||
| *Branch Protection funktioniert korrekt!* 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,86 @@ | ||
| # 🔧 Workflow Branch Protection Fix | ||
|
|
||
| ## 🚨 Problem behoben | ||
|
|
||
| ### Ursprüngliches Problem: | ||
| ```bash | ||
| git push origin main ← BLOCKIERT durch Branch Protection! | ||
| git push origin "v$NEW_VERSION" | ||
| ``` | ||
|
|
||
| **Fehler:** | ||
| ``` | ||
| remote: error: GH013: Repository rule violations found for refs/heads/main | ||
| remote: - Changes must be made through a pull request | ||
| ``` | ||
|
|
||
| ### ✅ Lösung implementiert: | ||
| ```bash | ||
| # Tag erstellen und pushen (ohne main-Branch zu berühren) | ||
| git tag -a "v$NEW_VERSION" -m "Automatic release v$NEW_VERSION" | ||
| git push origin "v$NEW_VERSION" ← NUR Tag-Push, kein main-Push! | ||
| ``` | ||
|
|
||
| ## 🎯 Was geändert wurde | ||
|
|
||
| ### Entfernt: | ||
| - ❌ `git push origin main` - Nicht nötig für Releases! | ||
|
|
||
| ### Beibehalten: | ||
| - ✅ `git push origin "v$NEW_VERSION"` - Tag-Push ist erlaubt | ||
| - ✅ GitHub Release creation | ||
| - ✅ Asset uploads | ||
| - ✅ PyPI publishing | ||
|
|
||
| ## 🛡️ Warum das besser ist | ||
|
|
||
| ### Branch Protection bleibt aktiv: | ||
| - 🔒 **Kein direkter Push auf main** - Sicherheit | ||
| - 📝 **Alle Änderungen über PRs** - Code Review | ||
| - 🧪 **Status Checks erforderlich** - Qualität | ||
| - 🔍 **Code Scanning aktiv** - Sicherheit | ||
|
|
||
| ### Workflow funktioniert trotzdem: | ||
| - ✅ **Tags werden erstellt** - Für Releases | ||
| - ✅ **GitHub Releases** - Automatisch | ||
| - ✅ **Assets hochgeladen** - Packages verfügbar | ||
| - ✅ **PyPI Publishing** - Automatisch | ||
|
|
||
| ## 🔄 Neuer Workflow | ||
|
|
||
| ### Was passiert bei Merge-Commits: | ||
| 1. **Merge erkannt** → `Merge pull request #X` | ||
| 2. **Version berechnet** → v1.11.0 | ||
| 3. **Tag erstellt** → `v1.11.0` | ||
| 4. **Tag gepusht** → Nur Tag, nicht main! | ||
| 5. **Release erstellt** → GitHub Release | ||
| 6. **Assets hochgeladen** → Packages verfügbar | ||
|
|
||
| ### Kein main-Push nötig: | ||
| - Tags können unabhängig von Branches gepusht werden | ||
| - GitHub Releases werden von Tags erstellt | ||
| - Branch Protection wird respektiert | ||
|
|
||
| ## 🧪 Test-Erwartung | ||
|
|
||
| **Nächster Merge sollte funktionieren:** | ||
| ``` | ||
| ✅ Merge commit detected | ||
| ✅ Version: v1.11.0 | ||
| ✅ Tag created: v1.11.0 | ||
| ✅ Tag pushed successfully (no main push) | ||
| ✅ GitHub Release created | ||
| ✅ Assets uploaded | ||
| ✅ PyPI published | ||
| ``` | ||
|
|
||
| ## ✨ Vorteile | ||
|
|
||
| - 🛡️ **Maximale Sicherheit** - Branch Protection aktiv | ||
| - 🚀 **Automatische Releases** - Funktionieren weiterhin | ||
| - 📦 **Alle Features** - Packages, PyPI, Assets | ||
| - 🔄 **Pull Request Workflow** - Professionell | ||
|
|
||
| --- | ||
|
|
||
| *Branch Protection + Automatische Releases = Perfekte Kombination!* 🎉 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Version File Updates Not Pushed to Main
The workflow commits version file updates (VERSION,
__version__.py,pyproject.toml) locally but no longer pushes these changes to themainbranch. This leavesmain's version files outdated, which can lead to incorrect future version calculations. It also creates an inconsistent state where the release tag references a commit not present on the remotemainbranch.Additional Locations (1)
WORKFLOW_BRANCH_PROTECTION_FIX.md#L57-L64