Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ jobs:
# Checks-out the repository under $GITHUB_WORKSPACE, so the job can access it
- name: Check out repo
uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'pull_request' && github.head_ref || github.ref_name }}

- name: Verify checked-out branch
run: |
echo "Checked out branch: $(git rev-parse --abbrev-ref HEAD)"

- name: Set up MATLAB
uses: matlab-actions/setup-matlab@v2
Expand Down
25 changes: 25 additions & 0 deletions code/+matbox/+git/deleteGitTag.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
function deleteGitTag(tagName, projectDirectory)
% deleteGitTag - Delete tag from repository (local and remotely)
%

arguments
tagName (1,1) string
projectDirectory (1,1) string {mustBeFolder} = pwd
end

if ~strcmp(pwd, projectDirectory)
currentWorkingDir = pwd;
cleanupObj = onCleanup(@(fn) cd(currentWorkingDir));
cd(projectDirectory)
end

%[s,m] = system( '$(git rev-parse --abbrev-ref HEAD) == "main"' )

Comment on lines +16 to +17
[s1, m1] = system(sprintf("git tag --delete %s", tagName));
assert(s1==0, 'MATBOX:GitUtility:DeleteTagFailed', ...
'Failed to delete local tag. Reason: %s', m1);

[s2, m2] = system(sprintf("git push --delete origin %s", tagName));
Comment on lines +18 to +22
assert(s2==0, 'MATBOX:GitUtility:DeleteTagFailed', ...
'Failed to delete remote tag. Reason: %s', m2);
end
Loading