A customizable GitHub Actions setup to streamline and automate development workflows.
Full environment setup:
pip install -r requirements.txt- Git Conventional Commits check using pre-commit.
- Git Semantic Release using action-for-semantic-release.
- Auto Assign Pull Request by kentaro-m/auto-assign-action.
- Check Docker Image building.
- Check LaTeX document building by xu-cheng/latex-action.
- Build and push docker image to Docker Hub.
This project follows the Conventional Commits specification. Please install the Git commit hooks before making commits:
pre-commit install
pre-commit install --hook-type commit-msgFollow these two steps to enable automatic assignment and allow Actions to create and approve pull requests.
- Create a new ruleset in your repository:
Settings > Rules > Rulesetsand import the JSON below (do not modify the JSON). To make the file easier to read, the JSON is collapsed by default — click to expand:
Show JSON ruleset (click to expand)
{
"id": 5813723,
"name": "Protect Main",
"target": "branch",
"source_type": "Repository",
"source": "merendamattia/devops-automation-hub",
"enforcement": "active",
"conditions": {
"ref_name": {
"exclude": [],
"include": [
"~DEFAULT_BRANCH"
]
}
},
"rules": [
{
"type": "deletion"
},
{
"type": "non_fast_forward"
},
{
"type": "pull_request",
"parameters": {
"required_approving_review_count": 1,
"dismiss_stale_reviews_on_push": false,
"require_code_owner_review": true,
"require_last_push_approval": false,
"required_review_thread_resolution": true,
"automatic_copilot_code_review_enabled": true,
"allowed_merge_methods": [
"merge",
"rebase"
]
}
},
{
"type": "copilot_code_review",
"parameters": {
"review_on_push": true,
"review_draft_pull_requests": false
}
}
],
"bypass_actors": [
{
"actor_id": 5,
"actor_type": "RepositoryRole",
"bypass_mode": "always"
}
]
}- Grant workflows permission to create and approve PRs: go to
Settings > Actions > General > Workflow permissions, set "Read and write permissions", and enable "Allow GitHub Actions to create and approve pull requests".
To use semantic release, create a GitHub token (GH_TOKEN) with repo permissions and add it as a repository secret named GH_TOKEN.
To auto-build and push the Docker image after Semantic Release, add repository secrets:
DOCKERHUB_USERNAME: your docker username;DOCKERHUB_TOKEN: your personal access token (PAT);DOCKERHUB_REPO: the Docker Hub repository (format: username/repo).