Skip to content

Commit 481e0dc

Browse files
Copilotswissspidy
andcommitted
Remove separator comments and add permissions to workflows
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
1 parent eea9301 commit 481e0dc

File tree

10 files changed

+44
-12
lines changed

10 files changed

+44
-12
lines changed

.github/workflows/code-quality.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ on:
88
- main
99
- master
1010

11+
permissions:
12+
contents: read
13+
1114
jobs:
1215
code-quality:
1316
uses: wp-cli/.github/.github/workflows/reusable-code-quality.yml@main

.github/workflows/issue-triage.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ name: Issue and PR Triage
1313
required: false
1414
type: string
1515

16+
permissions:
17+
issues: write
18+
pull-requests: write
19+
actions: write
20+
contents: read
21+
1622
jobs:
1723
issue-triage:
1824
uses: wp-cli/.github/.github/workflows/reusable-issue-triage.yml@main

.github/workflows/regenerate-readme.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ on:
1010
- "features/**"
1111
- "README.md"
1212

13+
permissions:
14+
contents: write
15+
pull-requests: write
16+
1317
jobs:
1418
regenerate-readme:
1519
uses: wp-cli/.github/.github/workflows/reusable-regenerate-readme.yml@main

.github/workflows/reusable-code-quality.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ on:
99
required: false
1010
default: ''
1111

12+
permissions:
13+
contents: read
14+
1215
# Cancels all previous workflow runs for the same branch that have not yet completed.
1316
concurrency:
1417
# The concurrency group contains the workflow name and the branch name.
@@ -17,7 +20,7 @@ concurrency:
1720

1821
jobs:
1922

20-
actionlint: #-----------------------------------------------------------------------
23+
actionlint:
2124
name: Lint GitHub Actions workflows
2225
runs-on: ubuntu-latest
2326
steps:
@@ -34,7 +37,7 @@ jobs:
3437
with:
3538
args: -color -shellcheck=
3639

37-
lint: #-----------------------------------------------------------------------
40+
lint:
3841
name: Lint PHP files
3942
runs-on: ubuntu-latest
4043
steps:
@@ -95,7 +98,7 @@ jobs:
9598
env:
9699
ADDITIONAL_EXCLUDES: ${{ inputs.parallel-lint-excludes }}
97100

98-
lint-gherkin: #----------------------------------------------------------------
101+
lint-gherkin:
99102
name: Lint Gherkin Feature files
100103
runs-on: ubuntu-latest
101104
steps:
@@ -111,7 +114,7 @@ jobs:
111114
- name: Run linter
112115
run: npx --yes gherkin-lint -c $RUNNER_TEMP/.gherkin-lintrc
113116

114-
lint-spellcheck: #----------------------------------------------------------------
117+
lint-spellcheck:
115118
name: Spell check
116119
runs-on: ubuntu-latest
117120
steps:
@@ -128,7 +131,7 @@ jobs:
128131
if: steps.check_files.outputs.files_exists == 'true'
129132
uses: crate-ci/typos@v1.42.1
130133

131-
phpcs: #----------------------------------------------------------------------
134+
phpcs:
132135
name: PHPCS
133136
runs-on: ubuntu-latest
134137

@@ -177,7 +180,7 @@ jobs:
177180
cs2pr /tmp/phpcs-checkstyle-report.xml
178181
fi
179182
180-
phpstan: #----------------------------------------------------------------------
183+
phpstan:
181184
name: PHPStan
182185
runs-on: ubuntu-latest
183186

.github/workflows/reusable-regenerate-readme.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ name: Regenerate README file
33
on:
44
workflow_call:
55

6+
permissions:
7+
contents: write
8+
pull-requests: write
9+
610
# Cancels all previous workflow runs for the same branch that have not yet completed.
711
concurrency:
812
# The concurrency group contains the workflow name and the branch name.
@@ -12,7 +16,7 @@ concurrency:
1216

1317
jobs:
1418

15-
regenerate-readme: #----------------------------------------------------------
19+
regenerate-readme:
1620
name: Regenerate README.md file
1721
runs-on: ubuntu-latest
1822
if: ${{ github.repository_owner == 'wp-cli' && ! contains(fromJson('[".github", "wp-cli", "wp-cli-bundle", "wp-super-cache-cli", "php-cli-tools", "wp-config-transformer", "wp-cli.github.com"]'), github.event.repository.name) }}

.github/workflows/reusable-testing.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ on:
2424
required: false
2525
default: '{ "include": [], "exclude": [] }'
2626

27+
permissions:
28+
contents: read
29+
2730
# Cancels all previous workflow runs for the same branch that have not yet completed.
2831
concurrency:
2932
# The concurrency group contains the workflow name and the branch name.
@@ -277,7 +280,7 @@ jobs:
277280
BASE_MATRIX: ${{ needs.get-matrix.outputs.matrix }}
278281
FILE_EXISTS: ${{ steps.check_files.outputs.files_exists == 'true' }}
279282

280-
unit: #-----------------------------------------------------------------------
283+
unit:
281284
needs: prepare-unit
282285
if: ${{ needs.prepare-unit.outputs.matrix != '' }}
283286
name: Unit test / PHP ${{ matrix.php }}${{ matrix.coverage && ' (with coverage)' || '' }} ${{ startsWith( matrix.os, 'windows' ) && '(Windows)' || '' }} ${{ startsWith( matrix.os, 'macos' ) && '(macOS)' || '' }}
@@ -341,7 +344,7 @@ jobs:
341344
flags: unit
342345
token: ${{ secrets.CODECOV_TOKEN }}
343346

344-
prepare-functional: #---------------------------------------------------------
347+
prepare-functional:
345348
name: Prepare matrix for functional tests
346349
needs: get-matrix
347350
runs-on: ubuntu-22.04
@@ -397,7 +400,7 @@ jobs:
397400
BASE_MATRIX: ${{ needs.get-matrix.outputs.matrix }}
398401
FILE_EXISTS: ${{ steps.check_files.outputs.files_exists == 'true' }}
399402

400-
functional: #-----------------------------------------------------------------
403+
functional:
401404
needs: prepare-functional
402405
if: ${{ needs.prepare-functional.outputs.matrix != '' }}
403406
name: Functional - WP ${{ matrix.wp }} on PHP ${{ matrix.php }} with ${{ matrix.dbtype != 'sqlite' && matrix.mysql || 'SQLite' }}${{ matrix.coverage && ' (with coverage)' || '' }} ${{ startsWith( matrix.os, 'windows' ) && '(Windows)' || '' }} ${{ startsWith( matrix.os, 'macos' ) && '(macOS)' || '' }}

.github/workflows/sync-workflows.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,12 @@ on:
99
schedule:
1010
- cron: '*/10 * * * *' # Run every 10 minutes.
1111

12+
permissions:
13+
contents: write
14+
1215
jobs:
1316

14-
sync-workflows: #-------------------------------------------------------------
17+
sync-workflows:
1518
name: Sync GitHub Actions workflows
1619
runs-on: ubuntu-latest
1720
if: ${{ github.repository_owner == 'wp-cli' }}
@@ -75,7 +78,7 @@ jobs:
7578
wp-cli/wp-super-cache-cli
7679
GITHUB_TOKEN: ${{ secrets.ACTIONS_BOT }}
7780

78-
sync-dependabot: #------------------------------------------------------------
81+
sync-dependabot:
7982
name: Sync Dependabot configuration
8083
runs-on: ubuntu-latest
8184
if: ${{ github.repository_owner == 'wp-cli' }}

.github/workflows/testing.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ on:
1010
schedule:
1111
- cron: '17 1 * * *' # Run every day on a seemly random time.
1212

13+
permissions:
14+
contents: read
15+
1316
jobs:
1417
test:
1518
uses: wp-cli/.github/.github/workflows/reusable-testing.yml@main

.github/workflows/welcome-new-contributors.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ on:
77
- main
88
- master
99

10+
permissions:
11+
pull-requests: write
12+
1013
jobs:
1114
welcome:
1215
uses: wp-cli/.github/.github/workflows/reusable-welcome-new-contributors.yml@main

actionlint

5.49 MB
Binary file not shown.

0 commit comments

Comments
 (0)