Skip to content

Commit

Permalink
changelog_to_tag action - support other than "master" for the main br…
Browse files Browse the repository at this point in the history
…anch name, as well (linux-system-roles#291)
  • Loading branch information
nhosoi authored Jul 21, 2022
1 parent b5339a3 commit 3d8fdf9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .github/workflows/changelog_to_tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,20 @@ jobs:
echo "$line"
fi
done > ./.tagmsg.txt
_tagname=$( grep -m 1 "[0-9]*\.[0-9]*\.[0-9]*" CHANGELOG.md | sed -e "s/^.*\[\([0-9]*\.[0-9]*\.[0-9]*\)\].*/\1/" )
_tagname=$( grep -m 1 "[0-9]*\.[0-9]*\.[0-9]*" CHANGELOG.md | \
sed -e "s/^.*\[\([0-9]*\.[0-9]*\.[0-9]*\)\].*/\1/" )
git fetch --all --tags
for t in $( git tag -l ); do
if [[ $t == "$_tagname" ]]; then
echo INFO: tag $t already exists
exit 1
fi
done
# Get the main branch name, "master" or "main".
_branch=$( git branch -r | grep -o 'origin/HEAD -> origin/.*$' | \
awk -F'/' '{print $3}' )
echo ::set-output name=tagname::"$_tagname"
echo ::set-output name=branch::"$_branch"
- name: Create tag
uses: mathieudutour/[email protected]
with:
Expand All @@ -59,3 +64,4 @@ jobs:
uses: robertdebock/[email protected]
with:
galaxy_api_key: ${{ secrets.galaxy_api_key }}
git_branch: ${{ steps.tag.outputs.branch }}

0 comments on commit 3d8fdf9

Please sign in to comment.