Skip to content
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

test github token #31931

Merged
merged 13 commits into from
Nov 16, 2024
21 changes: 12 additions & 9 deletions .github/workflows/phpstan_baseline.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: 'PHPStan baseline'

on:
# Every Thursday we want to refresh the baseline
# Every day we want to refresh the baseline
schedule:
- cron: '0 6 * * 4'
- cron: '0 12 * * *'

# We want to be able to manually refresh the baseline too
workflow_dispatch:
Expand All @@ -14,18 +14,21 @@ on:
required: true
type: string
# Run PHPStan analyse on pull requests
#pull_request:
# pull_request:

permissions: {} # none

env:
PHP_VERSION: '8.2'
GH_TOKEN: ${{ github.token }}
gh_event: ${{ inputs.gh_event || github.event_name }}
CACHE_KEY_PART: ${{ ( inputs.gh_event == 'pull_request' || github.event_name == 'pull_request' ) && format('{0}-{1}', github.base_ref, github.head_ref) || github.ref_name }}
jobs:
phpstan:
runs-on: ubuntu-latest
permissions: write-all
# contents: write
# pull-requests: write
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -54,7 +57,7 @@ jobs:
phpstan-cache-${{ env.PHP_VERSION }}-
- uses: ruudk/phpstan-baseline-refresh-create-pr-action@main
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
github_token: ${{ env.GH_TOKEN }}
phpstan_path: phpstan
configuration_path: phpstan.neon.dist
phpstan_additional_arguments: --memory-limit 7G -a build/phpstan/bootstrap_action.php
Expand All @@ -63,8 +66,8 @@ jobs:
commit_email: [email protected]
commit_message: PHPStan > Update baseline
target_branch: develop
pr_create: ${{ (github.event_name == 'workflow_dispatch' || github.event_name == 'schedule') && 1 || 0 }}
# pr_create: 1
# pr_create: ${{ (github.event_name == 'workflow_dispatch' || github.event_name == 'schedule') && 1 || 0 }}
pr_create: 1
pr_title: PHPStan > Update baseline
pr_reviewer: eldy
pr_body: |
Expand Down
18 changes: 6 additions & 12 deletions htdocs/comm/propal/stats/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,18 +97,12 @@

$langs->loadLangs(array('propal', 'other', 'companies'));

$picto = null;
$dir = null;
$cat_type = null;
$cat_label = null;

if ($mode == 'customer') {
$picto = 'propal';
$title = $langs->trans("ProposalsStatistics");
$dir = $conf->propal->dir_temp;
$cat_type = Categorie::TYPE_CUSTOMER;
$cat_label = $langs->trans("Category").' '.lcfirst($langs->trans("Customer"));
}
$picto = 'propal';
$title = $langs->trans("ProposalsStatistics");
$dir = $conf->propal->dir_temp;
$cat_type = Categorie::TYPE_CUSTOMER;
$cat_label = $langs->trans("Category").' '.lcfirst($langs->trans("Customer"));

if ($mode == 'supplier') {
$picto = 'supplier_proposal';
$title = $langs->trans("ProposalsStatisticsSuppliers");
Expand Down
5 changes: 2 additions & 3 deletions htdocs/commande/stats/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -304,9 +304,8 @@
$head[$h][2] = 'byyear';
$h++;

if ($mode == 'customer') {
$type = 'order_stats';
}
$type = 'order_stats';

if ($mode == 'supplier') {
$type = 'supplier_order_stats';
}
Expand Down
2 changes: 2 additions & 0 deletions htdocs/product/stock/productlot_document.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@
$modulepart = 'product_batch';
$object = new Productlot($db);
if ($id || $ref) {
$productid = 0;
$batch = '';
if ($ref) {
$tmp = explode('_', $ref);
$productid = $tmp[0];
Expand Down
Loading