Skip to content

Merge pull request #18 from TaloDev/develop #20

Merge pull request #18 from TaloDev/develop

Merge pull request #18 from TaloDev/develop #20

Workflow file for this run

name: Tag
on:
push:
branches: [ main ]
jobs:
tag:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check version change
id: check
run: |
latest=$(curl --silent "https://api.github.com/repos/${{ github.repository }}/releases/latest" | jq -r .tag_name)
current=$(grep -oP 'version="\K[^"]+' addons/talo/plugin.cfg)
if [[ -z "$latest" ]]; then
echo "changed=true" >> $GITHUB_OUTPUT
echo "version=$current" >> $GITHUB_OUTPUT
elif [[ "$latest" != "$current" ]]; then
echo "changed=true" >> $GITHUB_OUTPUT
echo "version=$current" >> $GITHUB_OUTPUT
else
echo "changed=false" >> $GITHUB_OUTPUT
fi
- name: Create tag
if: steps.check.outputs.changed == 'true'
uses: pxpm/[email protected]
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ steps.check.outputs.version }}
- name: Trigger workflow
if: steps.check.outputs.changed == 'true'
uses: actions/github-script@v7
with:
script: |
github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: 'create-release.yml',
ref: '${{ steps.check.outputs.version }}'
})