Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NEW Add workflow for tagging patch releases #66

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
}
Loading