Skip to content

Commit

Permalink
FIX Add actions write permission to token when using gha-tag-release
Browse files Browse the repository at this point in the history
  • Loading branch information
emteknetnz committed Aug 22, 2024
1 parent 364144a commit f737a2c
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 f737a2c

Please sign in to comment.