-
Notifications
You must be signed in to change notification settings - Fork 2
[WIP] Run tests with github actions #31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 1.0.x
Are you sure you want to change the base?
Conversation
| - name: Checkout | ||
| uses: actions/checkout@v5 | ||
| - name: Setup PHP | ||
| uses: shivammathur/setup-php@v2 |
Check warning
Code scanning / CodeQL
Unpinned tag for a non-immutable Action in workflow Medium
Uses Step
| name: Unit tests | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| php-version: [8.2, 8.3, 8.4] | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v5 | ||
| - name: Setup PHP | ||
| uses: shivammathur/setup-php@v2 | ||
| with: | ||
| php-version: ${{ matrix.php-version }} | ||
| - name: Composer install | ||
| run: composer install | ||
| - name: Run tests | ||
| run: composer run-script code:test |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 17 days ago
To address the problem, you should add a permissions block at the root level of the workflow file (.github/workflows/pull_request.yml). The block should grant only the minimal access required for the jobs within this workflow. Looking at the workflow, both job sections (linting, tests) only interact with the source code, they do not push commits, create comments, or open/close PRs, so the only permission strictly required is contents: read. The permissions block must be inserted after the name and before on, or at least before the jobs key, as per GitHub Actions YAML structure recommendations.
No additional methods, imports, or changes are necessary apart from adding this permissions block.
-
Copy modified lines R2-R3
| @@ -1,4 +1,6 @@ | ||
| name: Pull Request | ||
| permissions: | ||
| contents: read | ||
| on: | ||
| pull_request: | ||
| branches: |
|
https://www.purencool.digital/development/using-php-webserver-to-run-drupal note it misses a line break after |
No description provided.