From ac48811fe345fee048d2137e5b6877bb490469c6 Mon Sep 17 00:00:00 2001 From: Eason Su Date: Mon, 13 May 2024 15:05:25 +0800 Subject: [PATCH] Upgrade the templates to use latest versions of GitHub actions in the JS package `generator-grow`. --- .../github/templates/workflows/branch-labels.yml | 8 ++++++-- .../phpcs/templates/php-coding-standards-diff.yml | 2 +- .../generators/phpcs/templates/php-coding-standards.yml | 4 ++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/packages/js/generator-grow/generators/github/templates/workflows/branch-labels.yml b/packages/js/generator-grow/generators/github/templates/workflows/branch-labels.yml index 8c80a99a..99561119 100644 --- a/packages/js/generator-grow/generators/github/templates/workflows/branch-labels.yml +++ b/packages/js/generator-grow/generators/github/templates/workflows/branch-labels.yml @@ -1,11 +1,15 @@ name: Set PR Labels on: - pull_request: + pull_request_target: types: opened + jobs: SetLabels: + permissions: + contents: read + pull-requests: write runs-on: ubuntu-latest steps: - name: Set Labels - uses: woocommerce/grow/branch-label@actions-v1 + uses: woocommerce/grow/branch-label@actions-v2 diff --git a/packages/js/generator-grow/generators/phpcs/templates/php-coding-standards-diff.yml b/packages/js/generator-grow/generators/phpcs/templates/php-coding-standards-diff.yml index b3e7c58c..441d83cf 100644 --- a/packages/js/generator-grow/generators/phpcs/templates/php-coding-standards-diff.yml +++ b/packages/js/generator-grow/generators/phpcs/templates/php-coding-standards-diff.yml @@ -16,6 +16,6 @@ jobs: runs-on: ubuntu-latest steps: - name: Run PHPCS to changed lines of code - uses: woocommerce/grow/phpcs-diff@actions-v1 + uses: woocommerce/grow/phpcs-diff@actions-v2 with: php-version: <%= phpVersion %> diff --git a/packages/js/generator-grow/generators/phpcs/templates/php-coding-standards.yml b/packages/js/generator-grow/generators/phpcs/templates/php-coding-standards.yml index d9772b6e..83949d3d 100644 --- a/packages/js/generator-grow/generators/phpcs/templates/php-coding-standards.yml +++ b/packages/js/generator-grow/generators/phpcs/templates/php-coding-standards.yml @@ -24,10 +24,10 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Prepare PHP - uses: woocommerce/grow/prepare-php@actions-v1 + uses: woocommerce/grow/prepare-php@actions-v2 with: php-version: <%= phpVersion %> tools: cs2pr