Skip to content

Trigger release

Trigger release #91

Workflow file for this run

name: Trigger release
on:
workflow_dispatch:
workflow_run:
workflows: ["Sync repo"]
types:
- completed
jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Find latest tag of source repo
uses: oprypin/find-latest-tag@v1
with:
repository: casey/just
regex: '^\d+\.\d+\.\d+$'
releases-only: true
id: sourcetag
- name: Find latest tag of target repo
uses: oprypin/find-latest-tag@v1
with:
repository: gnpaone/rust-just
releases-only: true
id: targettag
- run: npm install semver
- name: Check for new release
uses: actions/github-script@v7
id: rel-chk
with:
script: |
const semver = require('semver');
const ver1 = `${{ steps.sourcetag.outputs.tag }}`;
const ver2 = `${{ steps.targettag.outputs.tag }}`;
if (semver.gt(ver1, ver2)) {
core.setOutput('create_release', true);
} else {
core.setOutput('create_release', false);
}
- name: Trigger release event
if: steps.rel-chk.outputs.create_release == 'true'
uses: peter-evans/repository-dispatch@v3
with:
event-type: new-release