Skip to content

Commit

Permalink
protect main branch from direct commits
Browse files Browse the repository at this point in the history
  • Loading branch information
mpadge committed Feb 16, 2025
1 parent 9e9079b commit 352bfe1
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .hooks/no-commit-to-main
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env Rscript

# do not commit to main branch
on_main <- identical (gert::git_branch (), "main")
if (on_main)
stop ("main branch is protected on GitHub; commits must be made via PR from other branch")
4 changes: 4 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ repos:
name: Version has been incremeneted in DESCRIPTION
entry: .hooks/description
language: script
- id: Commit via PR only
name: Commit made to non-main branch
entry: .hooks/no-commit-to-main
language: script

ci:
autoupdate_schedule: monthly
Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: dodgr
Title: Distances on Directed Graphs
Version: 0.4.1.053
Version: 0.4.1.054
Authors@R: c(
person("Mark", "Padgham", , "[email protected]", role = c("aut", "cre")),
person("Andreas", "Petutschnig", role = "aut"),
Expand Down
2 changes: 1 addition & 1 deletion codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"codeRepository": "https://github.com/UrbanAnalyst/dodgr",
"issueTracker": "https://github.com/UrbanAnalyst/dodgr/issues",
"license": "https://spdx.org/licenses/GPL-3.0",
"version": "0.4.1.053",
"version": "0.4.1.054",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "R",
Expand Down

0 comments on commit 352bfe1

Please sign in to comment.