Add minimum required permissions for workflow token (#36200)

* Add minimum required permissions to e2e-tests

* Add minimum token permission to more workflows
This commit is contained in:
Roy Ho 2023-01-02 09:28:11 -08:00 committed by GitHub
parent d4ce6faf1e
commit 16386238cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
35 changed files with 193 additions and 0 deletions

View File

@ -1,5 +1,6 @@
name: Setup WooCommerce Monorepo name: Setup WooCommerce Monorepo
description: Handles the installation, building, and caching of the projects within the monorepo. description: Handles the installation, building, and caching of the projects within the monorepo.
permissions: {}
inputs: inputs:
install-filters: install-filters:

View File

@ -6,10 +6,15 @@ on:
description: 'By default the zip file is generated from the branch the workflow runs from, but you can specify an explicit reference to use instead here (e.g. refs/tags/tag_name or refs/heads/release/x.x). The resulting file will be available as an artifact on the workflow run.' description: 'By default the zip file is generated from the branch the workflow runs from, but you can specify an explicit reference to use instead here (e.g. refs/tags/tag_name or refs/heads/release/x.x). The resulting file will be available as an artifact on the workflow run.'
required: false required: false
default: '' default: ''
permissions: {}
jobs: jobs:
build: build:
name: Build release zip file name: Build release zip file
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
permissions:
contents: read
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3

View File

@ -2,10 +2,15 @@ name: Build release asset
on: on:
release: release:
types: [published] types: [published]
permissions: {}
jobs: jobs:
build: build:
name: Build release asset name: Build release asset
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
permissions:
contents: write
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3

View File

@ -30,6 +30,8 @@ env:
GIT_AUTHOR_NAME: 'WooCommerce Bot' GIT_AUTHOR_NAME: 'WooCommerce Bot'
GIT_AUTHOR_EMAIL: 'no-reply@woocommerce.com' GIT_AUTHOR_EMAIL: 'no-reply@woocommerce.com'
permissions: {}
jobs: jobs:
verify: verify:
name: Verify name: Verify
@ -122,6 +124,10 @@ jobs:
cherry-pick-run: cherry-pick-run:
name: Run cherry pick tool name: Run cherry pick tool
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
permissions:
actions: write
contents: write
pull-requests: write
needs: [prep, check-release-branch-exists] needs: [prep, check-release-branch-exists]
if: success() if: success()
steps: steps:

View File

@ -12,11 +12,16 @@ defaults:
concurrency: concurrency:
group: ${{ github.workflow }}-${{ github.ref }} group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true cancel-in-progress: true
permissions: {}
jobs: jobs:
test: test:
name: PHP ${{ matrix.php }} WP ${{ matrix.wp }} name: PHP ${{ matrix.php }} WP ${{ matrix.wp }}
timeout-minutes: 30 timeout-minutes: 30
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
permissions:
contents: read
continue-on-error: ${{ matrix.wp == 'nightly' }} continue-on-error: ${{ matrix.wp == 'nightly' }}
strategy: strategy:
fail-fast: false fail-fast: false

View File

@ -10,10 +10,14 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }} group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true cancel-in-progress: true
permissions: {}
jobs: jobs:
verify: verify:
name: Verify name: Verify
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
permissions:
contents: read
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3

View File

@ -8,10 +8,14 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }} group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true cancel-in-progress: true
permissions: {}
jobs: jobs:
cot-e2e-tests-run: cot-e2e-tests-run:
name: Runs E2E tests with COT enabled. name: Runs E2E tests with COT enabled.
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
permissions:
contents: read
env: env:
ALLURE_RESULTS_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/e2e-pw/allure-results ALLURE_RESULTS_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/e2e-pw/allure-results
ALLURE_REPORT_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/e2e-pw/allure-report ALLURE_REPORT_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/e2e-pw/allure-report
@ -66,6 +70,8 @@ jobs:
cot-api-tests-run: cot-api-tests-run:
name: Runs API tests with COT enabled. name: Runs API tests with COT enabled.
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
permissions:
contents: read
env: env:
ALLURE_RESULTS_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/api-core-tests/api-test-report/allure-results ALLURE_RESULTS_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/api-core-tests/api-test-report/allure-results
ALLURE_REPORT_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/api-core-tests/api-test-report/allure-report ALLURE_REPORT_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/api-core-tests/api-test-report/allure-report
@ -124,6 +130,8 @@ jobs:
contains( needs.*.result, 'failure' ) contains( needs.*.result, 'failure' )
) )
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
permissions:
contents: read
needs: [cot-api-tests-run, cot-e2e-tests-run] needs: [cot-api-tests-run, cot-e2e-tests-run]
steps: steps:
- name: Create dirs - name: Create dirs

View File

@ -8,11 +8,15 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }} group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true cancel-in-progress: true
permissions: {}
jobs: jobs:
cot-e2e-tests-run: cot-e2e-tests-run:
name: Runs E2E tests with COT enabled. name: Runs E2E tests with COT enabled.
if: "${{ github.event_name == 'workflow_dispatch' || github.event.label.name == 'focus: custom order tables' }}" if: "${{ github.event_name == 'workflow_dispatch' || github.event.label.name == 'focus: custom order tables' }}"
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
permissions:
contents: read
env: env:
ALLURE_RESULTS_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/e2e-pw/allure-results ALLURE_RESULTS_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/e2e-pw/allure-results
ALLURE_REPORT_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/e2e-pw/allure-report ALLURE_REPORT_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/e2e-pw/allure-report
@ -68,6 +72,8 @@ jobs:
name: Runs API tests with COT enabled. name: Runs API tests with COT enabled.
if: "${{ github.event_name == 'workflow_dispatch' || github.event.label.name == 'focus: custom order tables' }}" if: "${{ github.event_name == 'workflow_dispatch' || github.event.label.name == 'focus: custom order tables' }}"
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
permissions:
contents: read
env: env:
ALLURE_RESULTS_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/api-core-tests/api-test-report/allure-results ALLURE_RESULTS_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/api-core-tests/api-test-report/allure-results
ALLURE_REPORT_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/api-core-tests/api-test-report/allure-report ALLURE_REPORT_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/api-core-tests/api-test-report/allure-report
@ -126,6 +132,8 @@ jobs:
contains( needs.*.result, 'failure' ) contains( needs.*.result, 'failure' )
) )
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
permissions:
contents: read
needs: [cot-api-tests-run, cot-e2e-tests-run] needs: [cot-api-tests-run, cot-e2e-tests-run]
steps: steps:
- name: Create dirs - name: Create dirs

View File

@ -4,11 +4,15 @@ on:
branches: ["trunk", "release/**"] branches: ["trunk", "release/**"]
workflow_dispatch: workflow_dispatch:
permissions: {}
jobs: jobs:
build: build:
if: github.repository == 'woocommerce/woocommerce' if: github.repository == 'woocommerce/woocommerce'
name: Build WooCommerce zip name: Build WooCommerce zip
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
permissions:
contents: read
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
@ -35,6 +39,8 @@ jobs:
name: Push to Mirror name: Push to Mirror
needs: [build] needs: [build]
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
permissions:
contents: read
steps: steps:
- name: Create directories - name: Create directories
run: | run: |

View File

@ -3,6 +3,9 @@ on:
schedule: schedule:
- cron: '0 0 * * *' # Run at 12 AM UTC. - cron: '0 0 * * *' # Run at 12 AM UTC.
workflow_dispatch: workflow_dispatch:
permissions: {}
jobs: jobs:
build: build:
if: github.repository_owner == 'woocommerce' if: github.repository_owner == 'woocommerce'
@ -12,6 +15,8 @@ jobs:
matrix: matrix:
build: [trunk] build: [trunk]
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
permissions:
contents: write
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
with: with:
@ -40,6 +45,8 @@ jobs:
update: update:
name: Update nightly tag commit ref name: Update nightly tag commit ref
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
permissions:
contents: write
steps: steps:
- name: Update nightly tag - name: Update nightly tag
uses: richardsimko/github-tag-action@v1.0.5 uses: richardsimko/github-tag-action@v1.0.5

View File

@ -6,10 +6,15 @@ on:
description: 'Enter a specific package to release, or releases separated by commas, ie @woocommerce/components,@woocommerce/number. Leaving this input blank will release all eligible packages.' description: 'Enter a specific package to release, or releases separated by commas, ie @woocommerce/components,@woocommerce/number. Leaving this input blank will release all eligible packages.'
required: false required: false
default: '-a' default: '-a'
permissions: {}
jobs: jobs:
release: release:
name: Run packages release script name: Run packages release script
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
permissions:
contents: read
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3

View File

@ -9,10 +9,15 @@ env:
GIT_AUTHOR_NAME: 'WooCommerce Bot' GIT_AUTHOR_NAME: 'WooCommerce Bot'
GIT_AUTHOR_EMAIL: 'no-reply@woocommerce.com' GIT_AUTHOR_EMAIL: 'no-reply@woocommerce.com'
permissions: {}
jobs: jobs:
changelog-version-update: changelog-version-update:
name: Update changelog and version name: Update changelog and version
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
permissions:
contents: write
pull-requests: write
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3

View File

@ -7,10 +7,14 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }} group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true cancel-in-progress: true
permissions: {}
jobs: jobs:
e2e-tests-run: e2e-tests-run:
name: Runs E2E tests. name: Runs E2E tests.
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
permissions:
contents: read
env: env:
ALLURE_RESULTS_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/e2e-pw/test-results/allure-results ALLURE_RESULTS_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/e2e-pw/test-results/allure-results
ALLURE_REPORT_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/e2e-pw/test-results/allure-report ALLURE_REPORT_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/e2e-pw/test-results/allure-report
@ -79,6 +83,8 @@ jobs:
api-tests-run: api-tests-run:
name: Runs API tests. name: Runs API tests.
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
permissions:
contents: read
env: env:
ALLURE_RESULTS_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/api-core-tests/test-results/allure-results ALLURE_RESULTS_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/api-core-tests/test-results/allure-results
ALLURE_REPORT_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/api-core-tests/test-results/allure-report ALLURE_REPORT_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/api-core-tests/test-results/allure-report
@ -129,6 +135,8 @@ jobs:
k6-tests-run: k6-tests-run:
name: Runs k6 Performance tests name: Runs k6 Performance tests
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
permissions:
contents: read
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
@ -162,6 +170,10 @@ jobs:
) )
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
needs: [api-tests-run, e2e-tests-run] needs: [api-tests-run, e2e-tests-run]
permissions:
contents: read
issues: write
pull-requests: write
env: env:
E2E_GRAND_TOTAL: ${{needs.e2e-tests-run.outputs.E2E_GRAND_TOTAL}} E2E_GRAND_TOTAL: ${{needs.e2e-tests-run.outputs.E2E_GRAND_TOTAL}}
steps: steps:

View File

@ -7,10 +7,14 @@ concurrency:
group: build-${{ github.event_name == 'push' && github.run_id || 'pr' }}-${{ github.ref }} group: build-${{ github.event_name == 'push' && github.run_id || 'pr' }}-${{ github.ref }}
cancel-in-progress: true cancel-in-progress: true
permissions: {}
jobs: jobs:
build: build:
if: github.repository_owner == 'woocommerce' if: github.repository_owner == 'woocommerce'
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
permissions:
contents: read
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3

View File

@ -8,11 +8,16 @@ defaults:
concurrency: concurrency:
group: ${{ github.workflow }}-${{ github.ref }} group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true cancel-in-progress: true
permissions: {}
jobs: jobs:
test: test:
name: Code coverage (PHP 7.4, WP Latest) name: Code coverage (PHP 7.4, WP Latest)
timeout-minutes: 30 timeout-minutes: 30
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
permissions:
contents: read
services: services:
database: database:
image: mysql:5.6 image: mysql:5.6

View File

@ -8,11 +8,16 @@ concurrency:
cancel-in-progress: true cancel-in-progress: true
env: env:
PHPCS: ./plugins/woocommerce/vendor/bin/phpcs # Run WooCommerce phpcs setup in phpcs-changed instead of default PHPCS: ./plugins/woocommerce/vendor/bin/phpcs # Run WooCommerce phpcs setup in phpcs-changed instead of default
permissions: {}
jobs: jobs:
test: test:
name: Code sniff (PHP 7.4, WP Latest) name: Code sniff (PHP 7.4, WP Latest)
timeout-minutes: 15 timeout-minutes: 15
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
permissions:
contents: read
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
with: with:

View File

@ -1,9 +1,14 @@
name: Highlight templates changes name: Highlight templates changes
on: pull_request on: pull_request
permissions: {}
jobs: jobs:
analyze: analyze:
name: Check pull request changes to highlight name: Check pull request changes to highlight
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
permissions:
contents: read
outputs: outputs:
results: ${{ steps.results.outputs.results }} results: ${{ steps.results.outputs.results }}
steps: steps:

View File

@ -6,10 +6,15 @@ on:
concurrency: concurrency:
group: changelogger-${{ github.event_name }}-${{ github.ref }} group: changelogger-${{ github.event_name }}-${{ github.ref }}
cancel-in-progress: true cancel-in-progress: true
permissions: {}
jobs: jobs:
changelogger_used: changelogger_used:
name: Changelogger use name: Changelogger use
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
permissions:
contents: read
timeout-minutes: 15 timeout-minutes: 15
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3

View File

@ -5,10 +5,14 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }} group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true cancel-in-progress: true
permissions: {}
jobs: jobs:
lint-test-js: lint-test-js:
name: Lint and Test JS name: Lint and Test JS
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
permissions:
contents: read
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3

View File

@ -8,9 +8,14 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }} group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true cancel-in-progress: true
permissions: {}
jobs: jobs:
label_project: label_project:
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
permissions:
contents: read
pull-requests: write
steps: steps:
- uses: actions/labeler@v3 - uses: actions/labeler@v3
with: with:

View File

@ -9,11 +9,16 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }} group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true cancel-in-progress: true
permissions: {}
jobs: jobs:
prcheck: prcheck:
name: Smoke test a pull request. name: Smoke test a pull request.
if: "${{ contains(github.event.label.name, 'run: smoke tests') }}" if: "${{ contains(github.event.label.name, 'run: smoke tests') }}"
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
permissions:
contents: read
pull-requests: write
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3

View File

@ -8,11 +8,15 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }} group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true cancel-in-progress: true
permissions: {}
jobs: jobs:
test: test:
name: PHP ${{ matrix.php }} WP ${{ matrix.wp }} name: PHP ${{ matrix.php }} WP ${{ matrix.wp }}
timeout-minutes: 30 timeout-minutes: 30
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
permissions:
contents: read
continue-on-error: ${{ matrix.wp == 'nightly' }} continue-on-error: ${{ matrix.wp == 'nightly' }}
strategy: strategy:
fail-fast: false fail-fast: false

View File

@ -6,10 +6,16 @@ on:
description: 'Enter a specific package to release, or packages separated by commas, ie @woocommerce/components,@woocommerce/number. Leaving this input to the default "-a" will prepare to release all eligible packages.' description: 'Enter a specific package to release, or packages separated by commas, ie @woocommerce/components,@woocommerce/number. Leaving this input to the default "-a" will prepare to release all eligible packages.'
required: false required: false
default: '-a' default: '-a'
permissions: {}
jobs: jobs:
prepare: prepare:
name: Run prepare script name: Run prepare script
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
permissions:
contents: read
pull-requests: write
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3

View File

@ -9,10 +9,14 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }} group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true cancel-in-progress: true
permissions: {}
jobs: jobs:
prime: prime:
name: Prime cache name: Prime cache
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
permissions:
contents: read
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3

View File

@ -3,11 +3,15 @@ on:
pull_request_target: pull_request_target:
types: [closed] types: [closed]
permissions: {}
jobs: jobs:
process-pull-request-after-merge: process-pull-request-after-merge:
name: "Process a pull request after it's merged" name: "Process a pull request after it's merged"
if: github.event.pull_request.merged == true if: github.event.pull_request.merged == true
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
permissions:
pull-requests: write
steps: steps:
- name: "Get the action scripts" - name: "Get the action scripts"
run: | run: |

View File

@ -15,9 +15,14 @@ env:
GIT_AUTHOR_NAME: 'WooCommerce Bot' GIT_AUTHOR_NAME: 'WooCommerce Bot'
GIT_AUTHOR_EMAIL: 'no-reply@woocommerce.com' GIT_AUTHOR_EMAIL: 'no-reply@woocommerce.com'
permissions: {}
jobs: jobs:
create-changelog-prs: create-changelog-prs:
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
permissions:
contents: read
pull-requests: write
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v3 uses: actions/checkout@v3

View File

@ -20,6 +20,8 @@ env:
GIT_AUTHOR_NAME: 'WooCommerce Bot' GIT_AUTHOR_NAME: 'WooCommerce Bot'
GIT_AUTHOR_EMAIL: 'no-reply@woocommerce.com' GIT_AUTHOR_EMAIL: 'no-reply@woocommerce.com'
permissions: {}
jobs: jobs:
verify-code-freeze: verify-code-freeze:
name: 'Verify that today is the day of the code freeze' name: 'Verify that today is the day of the code freeze'
@ -57,6 +59,8 @@ jobs:
maybe-create-next-milestone-and-release-branch: maybe-create-next-milestone-and-release-branch:
name: 'Maybe create next milestone and release branch' name: 'Maybe create next milestone and release branch'
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
permissions:
contents: read
needs: verify-code-freeze needs: verify-code-freeze
if: needs.verify-code-freeze.outputs.freeze == 0 if: needs.verify-code-freeze.outputs.freeze == 0
outputs: outputs:
@ -84,6 +88,9 @@ jobs:
prep-trunk: prep-trunk:
name: Preps trunk for next development cycle name: Preps trunk for next development cycle
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
permissions:
contents: read
pull-requests: write
needs: maybe-create-next-milestone-and-release-branch needs: maybe-create-next-milestone-and-release-branch
steps: steps:
- name: Checkout code - name: Checkout code
@ -151,6 +158,8 @@ jobs:
trigger-changelog-action: trigger-changelog-action:
name: 'Trigger changelog action' name: 'Trigger changelog action'
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
permissions:
actions: write
needs: maybe-create-next-milestone-and-release-branch needs: maybe-create-next-milestone-and-release-branch
steps: steps:
- name: 'Trigger changelog action' - name: 'Trigger changelog action'

View File

@ -3,6 +3,8 @@ on:
schedule: schedule:
- cron: '25 7 * * *' - cron: '25 7 * * *'
permissions: {}
jobs: jobs:
ping_site: ping_site:
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04

View File

@ -14,10 +14,14 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }} group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true cancel-in-progress: true
permissions: {}
jobs: jobs:
e2e-tests: e2e-tests:
name: E2E tests on nightly build name: E2E tests on nightly build
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
permissions:
contents: read
env: env:
ADMIN_PASSWORD: ${{ secrets.SMOKE_TEST_ADMIN_PASSWORD }} ADMIN_PASSWORD: ${{ secrets.SMOKE_TEST_ADMIN_PASSWORD }}
ADMIN_USER: ${{ secrets.SMOKE_TEST_ADMIN_USER }} ADMIN_USER: ${{ secrets.SMOKE_TEST_ADMIN_USER }}
@ -77,6 +81,8 @@ jobs:
api-tests: api-tests:
name: API tests on nightly build name: API tests on nightly build
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
permissions:
contents: read
needs: [e2e-tests] needs: [e2e-tests]
if: success() || failure() if: success() || failure()
env: env:
@ -121,6 +127,8 @@ jobs:
k6-tests: k6-tests:
name: k6 tests on nightly build name: k6 tests on nightly build
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
permissions:
contents: read
needs: [api-tests] needs: [api-tests]
if: success() || failure() if: success() || failure()
steps: steps:
@ -171,6 +179,8 @@ jobs:
test-plugins: test-plugins:
name: Smoke tests on trunk with ${{ matrix.plugin }} plugin installed name: Smoke tests on trunk with ${{ matrix.plugin }} plugin installed
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
permissions:
contents: read
env: env:
USE_WP_ENV: 1 USE_WP_ENV: 1
ALLURE_RESULTS_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/e2e-pw/allure-results ALLURE_RESULTS_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/e2e-pw/allure-results
@ -244,6 +254,8 @@ jobs:
( success() || failure() ) && ( success() || failure() ) &&
! github.event.pull_request.head.repo.fork ! github.event.pull_request.head.repo.fork
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
permissions:
contents: read
needs: [test-plugins, k6-tests] needs: [test-plugins, k6-tests]
steps: steps:
- name: Create dirs - name: Create dirs

View File

@ -5,10 +5,15 @@ on:
release_id: release_id:
description: 'WooCommerce Release Id' description: 'WooCommerce Release Id'
required: true required: true
permissions: {}
jobs: jobs:
login-run: login-run:
name: Daily smoke test on release. name: Daily smoke test on release.
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
permissions:
contents: read
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
with: with:
@ -49,6 +54,8 @@ jobs:
test-wp-version: test-wp-version:
name: Smoke test on L-${{ matrix.wp }} WordPress version name: Smoke test on L-${{ matrix.wp }} WordPress version
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
permissions:
contents: read
strategy: strategy:
matrix: matrix:
wp: ['1', '2'] wp: ['1', '2']
@ -104,6 +111,8 @@ jobs:
test-plugins: test-plugins:
name: Smoke tests with ${{ matrix.plugin }} plugin installed name: Smoke tests with ${{ matrix.plugin }} plugin installed
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
permissions:
contents: read
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:

View File

@ -3,11 +3,17 @@ on:
schedule: schedule:
- cron: '21 0 * * *' - cron: '21 0 * * *'
permissions: {}
jobs: jobs:
stale: stale:
if: | if: |
! contains(github.event.issue.labels.*.name, 'type: enhancement') ! contains(github.event.issue.labels.*.name, 'type: enhancement')
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
permissions:
contents: read
issues: write
pull-requests: write
steps: steps:
- uses: actions/stale@v3 - uses: actions/stale@v3
with: with:

View File

@ -6,9 +6,14 @@ on:
- trunk - trunk
paths: paths:
- '**/package.json' - '**/package.json'
permissions: {}
jobs: jobs:
syncpack: syncpack:
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions:
contents: read
name: syncpack name: syncpack
steps: steps:
- name: 'Checkout' - name: 'Checkout'

View File

@ -4,9 +4,14 @@ on:
issues: issues:
types: opened types: opened
permissions: {}
jobs: jobs:
add_label: add_label:
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
permissions:
contents: read
issues: write
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- uses: actions-ecosystem/action-add-labels@v1 - uses: actions-ecosystem/action-add-labels@v1

View File

@ -3,6 +3,9 @@ on:
issues: issues:
types: types:
- labeled - labeled
permissions: {}
jobs: jobs:
add-dev-comment: add-dev-comment:
if: "github.event.label.name == 'needs: developer feedback'" if: "github.event.label.name == 'needs: developer feedback'"

View File

@ -1,6 +1,8 @@
name: 'Update contributor feedback labels on comment' name: 'Update contributor feedback labels on comment'
on: 'issue_comment' on: 'issue_comment'
permissions: {}
jobs: jobs:
feedback: feedback:
if: | if: |
@ -10,6 +12,8 @@ jobs:
github.event.issue.state == 'open' && github.event.issue.state == 'open' &&
contains(github.event.issue.labels.*.name, 'needs: author feedback') contains(github.event.issue.labels.*.name, 'needs: author feedback')
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
permissions:
issues: write
steps: steps:
- name: Add has feedback - name: Add has feedback
uses: actions-ecosystem/action-add-labels@v1 uses: actions-ecosystem/action-add-labels@v1