Merge pull request #21 from typemytype/main #27
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Create a tag | |
on: | |
push | |
permissions: write-all | |
jobs: | |
create_tag_from_pr: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Read yaml | |
uses: actions-tools/yaml-outputs@v2 | |
id: info-action | |
with: | |
file-path: info.yaml | |
- name: Read version from yaml | |
run : | | |
echo version: ${{ steps.info-action.outputs.version }} | |
- name: Create tag if not present | |
run: | | |
if [ $(git tag -l "${{ steps.info-action.outputs.version }}") ]; then | |
echo "Tag ${{ steps.info-action.outputs.version }} exists" | |
else | |
echo "Create tag ${{ steps.info-action.outputs.version }}" | |
git config --global user.name "${GITHUB_ACTOR}" | |
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com" | |
git tag -a ${{ steps.info-action.outputs.version }} -m "Version ${{ steps.info-action.outputs.version }}" | |
git push origin "${{ steps.info-action.outputs.version }}" | |
fi |