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 e71ceca
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions scripts/cms-any/tag-patch-release.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php

$account = module_account();

$content = <<<EOT
name: Tag patch release
on:
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#workflow_dispatch
workflow_dispatch:
inputs:
latest_local_sha:
description: The latest local sha
required: true
type: string
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 e71ceca

Please sign in to comment.