Skip to content

Fix/workflow branch protection#7

Merged
behrangsa merged 5 commits into
masterfrom
fix/workflow-branch-protection
Aug 27, 2025
Merged

Fix/workflow branch protection#7
behrangsa merged 5 commits into
masterfrom
fix/workflow-branch-protection

Conversation

@behrangsa
Copy link
Copy Markdown
Contributor

This pull request updates the .github/workflows/release.yml workflow to improve automation and security for the release process. The main changes involve introducing an ADMIN_TOKEN secret to bypass branch protection rules, updating how repository access tokens are handled, and making the push operation safer during automated releases.

Release workflow improvements:

  • Added documentation and instructions for setting up an ADMIN_TOKEN secret, detailing required permissions and fallback behavior to GITHUB_TOKEN if ADMIN_TOKEN is not available.
  • Changed the token used during repository checkout from GITHUB_TOKEN to ADMIN_TOKEN, with automatic fallback to GITHUB_TOKEN if the admin token is not present.
  • Updated the git push operation to use --force-with-lease for safer pushes when admin permissions are used, and ensured the proper token is set in the environment for subsequent release steps.

This commit introduces a comprehensive GitHub Actions workflow that automates
the versioning and release process for keegees with the following features:

Automated Release Pipeline:
- Triggers on pushes to master branch with manual workflow_dispatch option
- Implements custom v-x.y.z tag format with automated patch version increments
- Creates both .tar.gz and .zip release archives with proper directory structure
- Generates professional release notes with installation instructions

Quality Assurance:
- Runs ShellCheck validation on keegees.sh and install.sh before releases
- Ensures code quality standards are maintained in automated releases
- Includes comprehensive error handling and validation steps

Release Management:
- Creates GitHub releases with detailed descriptions and usage examples
- Attaches source code archives for easy distribution
- Updates README version badges automatically
- Provides clear installation instructions and requirements

This workflow enables seamless automated releases while maintaining the
project's high quality standards and comprehensive documentation.
…nization and corrected baseline to v0.0.1

This commit significantly improves the automated release workflow and establishes proper version consistency across the entire codebase.

Workflow enhancements:
- Added comprehensive multi-file version synchronization that updates README.md version references and keegees.sh VERSION constant
- Implemented atomic commit functionality with [skip ci] tags to prevent recursive workflow triggers
- Enhanced workflow structure with proper step ordering and dependency management
- Added verification logging for all version update operations

Version baseline corrections:
- Fixed README.md CLI example version display: 1.0.0 → 0.0.1
- Fixed keegees.sh VERSION constant: 1.0.0 → 0.0.1
- Established consistent v0.0.1 baseline across git tags, GitHub releases, README.md, and keegees.sh

The enhanced workflow now ensures perfect version consistency across all project files and maintains the keegees project's professional standards with robust error handling and safety-first approach.
…ations

This commit addresses the branch protection rule violations in the release.yml workflow
that prevented the automated release process from pushing directly to the master branch.

Key improvements implemented:

Authentication enhancements:
- Updated checkout step to use ADMIN_TOKEN with fallback to GITHUB_TOKEN
- Added GITHUB_TOKEN environment variable for tag creation step
- Enhanced push strategy with --force-with-lease for safer admin-privileged operations

Documentation improvements:
- Added comprehensive setup instructions for ADMIN_TOKEN configuration
- Documented required Personal Access Token permissions (Contents, Actions, Pull requests, Repository administration)
- Explained fallback mechanism for backward compatibility

Technical changes:
- Modified git push to use --force-with-lease to prevent data loss while bypassing protection
- Maintained existing workflow logic and quality checks
- Preserved [skip ci] mechanism to prevent infinite recursion

This solution allows the GitHub Actions workflow to bypass branch protection rules
using an admin token with elevated permissions while maintaining system safety
and providing clear setup guidance for repository maintainers.
Cleaned up duplicate GitHub Actions workflow files by removing the obsolete
auto-tag-and-release.yml in favor of the comprehensive release.yml workflow.

The release.yml workflow contains all necessary functionality:
- Complete 10-step release process
- Proper vX.Y.Z version format throughout
- ADMIN_TOKEN configuration with GITHUB_TOKEN fallback
- Enhanced push strategy with --force-with-lease
- Dynamic version warning implementation
- Comprehensive setup documentation

This maintains clean CI/CD configuration while preserving all required
automation capabilities for the keegees project release process.
@behrangsa behrangsa merged commit 44820e2 into master Aug 27, 2025
2 checks passed
@behrangsa behrangsa deleted the fix/workflow-branch-protection branch August 27, 2025 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant