Skip to content

Commit

Permalink
NEW Add workflow for tagging patch releases
Browse files Browse the repository at this point in the history
  • Loading branch information
GuySartorelli committed Jul 30, 2024
1 parent 3580256 commit 7beb402
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions scripts/cms-any/tag-patch-release.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php

$account = module_account();

$content = <<<EOT
name: Tag patch release
inputs:
latest_local_sha:
description: The latest local sha
required: true
type: string
on:
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#repository_dispatch
repository_dispatch:
permissions: {}
jobs:
tagpatchrelease:
name: Tag patch release
# Only run cron on the $account account
if: (github.event_name == 'schedule' && github.repository_owner == '$account') || (github.event_name != 'schedule')
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Tag release
uses: silverstripe/gha-tag-release@v2
with:
latest_local_sha: \${{ inputs.latest_local_sha }}
EOT;

$workflowPath = '.github/workflows/tag-patch-release.yml';
$ciPath = '.github/workflows/ci.yml';

if (check_file_exists($ciPath)) {
write_file_even_if_exists($workflowPath, $content);
} else {
delete_file_if_exists($workflowPath);
}

0 comments on commit 7beb402

Please sign in to comment.