-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
NEW Add workflow for tagging patch releases (#66)
- Loading branch information
1 parent
3580256
commit fe4595f
Showing
1 changed file
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} |