Skip to content

Commit

Permalink
merging dev into master
Browse files Browse the repository at this point in the history
  • Loading branch information
orso82 authored Nov 4, 2024
2 parents 647a92d + 4bc4203 commit 8f3c712
Showing 1 changed file with 22 additions and 13 deletions.
35 changes: 22 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -205,15 +205,24 @@ blank_examples:clean_examples
cd docs; julia notebooks_to_md.jl

# @devs
branch_master: error_missing_repos_var
# GitHub merge of `branch` into `master` for a series of repos
# >> make branch_master branch=my_branch repos='FUSE IMAS IMASdd'
@$(foreach repo,$(repos), \
curl -X POST \
-H "Authorization: token $$(security find-generic-password -a orso82 -s GITHUB_TOKEN -w)" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/ProjectTorreyPines/$(repo).jl/merges \
-d '{"base": "master", "head": "$(branch)", "commit_message": "merging $(branch) into master"}';)
merge_remote: error_missing_repo_var error_missing_branch_var
# GitHub merge of `branch` into master for a given `repo`
# >> make merge_remote branch=my_branch repo=FUSE
@merge_response=$$(curl -s -o /dev/null -w "%{http_code}" -X POST \
-H "Authorization: token $$(security find-generic-password -a orso82 -s GITHUB_TOKEN -w)" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/ProjectTorreyPines/$(repo).jl/merges \
-d '{"base": "master", "head": "$(branch)", "commit_message": "merging $(branch) into master"}'); \
echo "Merge response code: $$merge_response"; \
if [ "$$merge_response" -eq 201 ]; then \
echo "Merge successful. Deleting branch $(branch) from remote..."; \
curl -X DELETE \
-H "Authorization: token $$(security find-generic-password -a orso82 -s GITHUB_TOKEN -w)" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/ProjectTorreyPines/$(repo).jl/git/refs/heads/$(branch); \
else \
echo "Merge failed with status code $$merge_response. Branch $(branch) was not deleted."; \
fi

# @devs
bump_major: error_missing_repo_var error_on_last_commit_is_a_version_bump versions_used
Expand Down Expand Up @@ -496,10 +505,10 @@ ifeq ($(repo),)
endif

# @devs
error_missing_repos_var:
# Throw an error if environment variable `repos` is not set
ifeq ($(repo),)
$(error `repos` variable is not set)
error_missing_branch_var:
# Throw an error if environment variable `branch` is not set
ifeq ($(branch),)
$(error `branch` variable is not set)
endif

# @devs
Expand Down

0 comments on commit 8f3c712

Please sign in to comment.