Open
Conversation
Comment on lines
9
to
147
| runs-on: ubuntu-22.04 | ||
| continue-on-error: ${{ matrix.experimental }} | ||
|
|
||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| php-version: ['8.1'] | ||
| experimental: [false] | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up PHP ${{ matrix.php-version }} | ||
| uses: shivammathur/setup-php@v2 | ||
| with: | ||
| php-version: ${{ matrix.php-version }} | ||
| env: | ||
| COMPOSER_TOKEN: ${{ secrets.COMPOSER_TOKEN }} | ||
|
|
||
| - name: Setup Packages | ||
| run: | | ||
| cd $GITHUB_WORKSPACE | ||
| sudo apt update | ||
| sudo apt install -y rsync postfix | ||
|
|
||
| # - name: Cache Composer dependencies | ||
| # uses: actions/cache@v2 | ||
| # with: | ||
| # path: /tmp/composer-cache | ||
| # key: ${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }} | ||
|
|
||
| - name: Install dependencies | ||
| uses: php-actions/composer@v6 | ||
| with: | ||
| dev: yes | ||
| args: --prefer-dist --no-interaction | ||
| php_version: ${{ matrix.php-version }} | ||
| php_extensions: xml | ||
| version: 2 | ||
|
|
||
| - name: Report Versions and show ENV vars | ||
| run: | | ||
| google-chrome --version | ||
| lsb_release -a | ||
| php -v | ||
| chromedriver -v | ||
| geckodriver -V | ||
| which geckodriver | ||
| which chromedriver | ||
| firefox -v | ||
| vendor/bin/behat -V | ||
| mysql --version | ||
| mysqladmin --version | ||
| export | ||
|
|
||
| - name: Create Database | ||
| run: | | ||
| sudo systemctl start mysql.service | ||
| sudo mysql -proot -e 'drop database if exists phplistdb; create database phplistdb;' | ||
| sudo mysql -proot -e 'create user phplist@"%" identified by "phplist"; grant all on phplistdb.* to phplist@"%"' | ||
| sudo gunzip -c tests/phplist-3.6.sql.gz | sudo mysql -proot phplistdb | ||
|
|
||
| - name: Set bootlist theme | ||
| run: | | ||
| cd $GITHUB_WORKSPACE/public_html/lists/admin/ui/ | ||
| wget https://github.com/phpList/phplist-ui-bootlist/archive/master.tar.gz | ||
| tar -xzf master.tar.gz | ||
| mv phplist-ui-bootlist-master phplist-ui-bootlist | ||
| rm master.tar.gz | ||
|
|
||
| - name: Start Test Server | ||
| run: | | ||
| cd $GITHUB_WORKSPACE | ||
| cp -fv tests/ci/behat.yml tests/behat.yml | ||
| cp -fv tests/ci/config.php public_html/lists/config/config.php | ||
| mkdir -p output/screenshots | ||
| touch output/screenshots/README.md | ||
| mkdir -p build/mails | ||
| smtp-sink -c -d "output/mails/%Y%m%d%H/%M." 2500 1024 & | ||
| ./bin/start-selenium > output/selenium.log 2>&1 & | ||
| sleep 5 | ||
| sudo php -S 0.0.0.0:80 -t public_html > /dev/null 2>&1 & | ||
|
|
||
| - name: Check PHP syntax errors | ||
| uses: overtrue/phplint@2.4.1 | ||
| with: | ||
| path: ./public_html | ||
|
|
||
| - name: Upgrade from 3.6 to 3.7 | ||
| run: | | ||
| php public_html/lists/admin/index.php -c $GITHUB_WORKSPACE/public_html/lists/config/config.php -p upgrade | ||
|
|
||
| - name: Run BDD Tests UI | ||
| run: | | ||
| cd $GITHUB_WORKSPACE/tests | ||
| ../vendor/bin/behat -p chrome -f progress --tags="~@initialise && ~@wip" | ||
|
|
||
| - name: Reset Database | ||
| run: | | ||
| sudo mysql -proot -e 'drop database if exists phplistdb; create database phplistdb;' | ||
|
|
||
| - name: Run BDD Tests UI | ||
| run: | | ||
| cd $GITHUB_WORKSPACE/tests | ||
| ../vendor/bin/behat -p chrome -f progress --stop-on-failure --tags=@initialise | ||
| ../vendor/bin/behat -p chrome -f progress --tags="~@initialise && ~@wip" | ||
|
|
||
| - name: Run BDD Tests CLI | ||
| run: | | ||
| cd $GITHUB_WORKSPACE | ||
| export ADMIN_EMAIL=admin@phplist.dev | ||
| export ADMIN_PASSWORD=Mypassword123+ | ||
| export ORGANISATION_NAME="phpList" | ||
| export ADMIN_NAME="phpList Administrator" | ||
| php public_html/lists/admin/index.php -c $GITHUB_WORKSPACE/public_html/lists/config/config.php -p initialise -f | ||
| cd $GITHUB_WORKSPACE/tests | ||
| ../vendor/bin/behat -p chrome -f progress --tags="~@initialise && ~@wip" | ||
|
|
||
| - name: copy screenshots | ||
| if: always() | ||
| run: | | ||
| cd $GITHUB_WORKSPACE | ||
| images=$(ls -l /tmp/*.png 2>/dev/null | wc -l) | ||
| [[ $images -gt 0 ]] && cp -v /tmp/*.png output/screenshots | ||
| exit 0; | ||
|
|
||
| - name: Upload the screenshots | ||
| if: always() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| path: "output" | ||
| name: "behat output ${{ matrix.php-version }}" | ||
| retention-days: 3 | ||
|
|
||
| - name: Display output | ||
| run: | | ||
| cd $GITHUB_WORKSPACE | ||
| # find . -type f | ||
| # cat output/selenium.log | ||
| if: ${{ failure() }} |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 7 months ago
To fix the problem, add a permissions block at the root of the workflow. This block will explicitly define the minimal permissions required for the workflow to run securely. Based on the workflow's operations (e.g., using actions like checkout and upload-artifact), the minimal permissions required are likely contents: read and potentially contents: write or other resource-specific permissions if needed.
- Add the
permissionskey at the root level of the workflow file. - Define the least privileges required for the workflow's tasks. For example:
contents: readto allow reading repository content.contents: writeif the workflow modifies the repository (e.g., pushes changes).- Additional permissions if specific actions (e.g., handling pull requests or issues) require them.
Suggested changeset
1
.github/workflows/upgrade.yml
| @@ -1,5 +1,7 @@ | ||
|
|
||
| name: Upgrade | ||
| permissions: | ||
| contents: read | ||
|
|
||
| on: | ||
| workflow_dispatch: |
Copilot is powered by AI and may make mistakes. Always verify output.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Update Ckeditor5 to version with view source button
Contributor License Agreement
before we can accept your PR, if you haven't done this yet, please sign the
Contributor License Agreement at https://www.phplist.com/cla
Many thanks
the phpList Team
-->
Related Issue
TatevikGr/phplist-plugin-ckeditor5#1
Screenshots (if appropriate):