Skip to content

Commit

Permalink
Merge pull request #70 from creative-commoners/pulls/main/tag-patch-r…
Browse files Browse the repository at this point in the history
…elease-permission

FIX Add actions write permission to token when using gha-tag-release
  • Loading branch information
GuySartorelli authored Aug 22, 2024
2 parents 364144a + f737a2c commit edd5ced
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions scripts/cms-any/tag-patch-release.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@

$account = module_account();

$permissions = <<<EOT
permissions:
contents: write
EOT;
if (is_gha_repository()) {
// gha repositories will dispatch auto-tag.yml from within the gha-tag-release action
$permissions = <<<EOT
permissions:
actions: write
contents: write
EOT;
}

$content = <<<EOT
name: Tag patch release
Expand All @@ -22,8 +35,7 @@
# 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
$permissions
steps:
- name: Tag release
uses: silverstripe/gha-tag-release@v2
Expand Down

0 comments on commit edd5ced

Please sign in to comment.