This project automates the creation of sprint branches based on a fixed 14-day sprint cycle using a Python script and GitHub Actions.
- Overview
- Features
- Installation
- Usage
- Workflow
- Generating a Personal Access Token (PAT)
- Creating Secrets in GitHub
- Contributing
- License
The purpose of this project is to automate the process of determining the start of a new sprint and creating a corresponding Git branch. The Python script calculates if today is the start of a new sprint based on a 14-day cycle and constructs a branch name. The GitHub Actions workflow runs the script daily and creates the branch if applicable.
- Automated Sprint Calculation: Determine the start of new sprints based on a fixed cycle.
- Dynamic Branch Creation: Automatically create and push sprint branches.
- Daily Automation: Runs daily at midnight UTC.
- Manual Trigger: Can be triggered manually via GitHub Actions.
- Clone the Repository:
git clone https://github.com/vib795/create_sprint_branch.git
cd create_sprint_branch
- Setup Python Environment: Ensure you have Python 3.x installed. You can set up a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
- Run the Script Manually: You can run the script manually to see if today is a sprint start day:
python scripts/calculate_sprint_details.py
- Configure GitHub Actions: Ensure the workflow file is located in the correct directory.
Configure GitHub Actions: Ensure the create_sprint_branch.yml
file is located in the .github/workflows/
directory of your repository.
The GitHub Actions workflow is configured to run the Python script daily at midnight UTC. If today is determined to be a sprint start day, it creates a new branch named according to the calculated sprint details and pushes it to the remote repository.
-
Go to GitHub Settings:
- Navigate to your GitHub account settings by clicking on your profile picture in the top right corner and selecting Settings.
-
Generate a New Token:
- In the left sidebar, click on Developer settings.
- Click on Personal access tokens.
- Click the Generate new token button.
-
Select Scopes:
- Give your token a descriptive name.
- Select the scopes, such as repo (Full control of private repositories).
- Click Generate token.
-
Save the Token:
- Copy the token and save it in a secure location. You will need it to create a secret in your GitHub repository.
-
Go to Your Repository:
- Navigate to your GitHub repository.
- Click on
Settings
.
-
Add a New Secret:
- In the left sidebar, click on
Secrets and variables
, thenActions
. - Click the
New repository
secret button. - Name the secret
GH_PAT
and paste your personal access token in the value field. - Click
Add secret
.
- In the left sidebar, click on
Contributions are welcome! Please submit a pull request or open an issue to discuss any changes or improvements.
This project is licensed under the MIT License.