Skip to content

Commit be50a1e

Browse files
Merge pull request #254 from Setasign/development
Fixed gh actions
2 parents ed167ed + c62f222 commit be50a1e

5 files changed

Lines changed: 49 additions & 30 deletions

File tree

.github/workflows/code-style.yml

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,20 @@
11
name: Code Style
22
on: [pull_request]
3+
4+
permissions: {}
5+
36
jobs:
47
phpcs:
58
name: phpcs
69
runs-on: ubuntu-latest
10+
permissions:
11+
code-quality: write
12+
713
steps:
814
- name: Check out code into the workspace
9-
uses: actions/checkout@v2
15+
uses: actions/checkout@v6
16+
with:
17+
persist-credentials: false
1018

1119
- name: Install php
1220
uses: shivammathur/setup-php@v2
@@ -16,29 +24,26 @@ jobs:
1624
- name: Install dependencies
1725
run: composer update --dev --no-interaction --prefer-dist --no-progress --no-suggest --ansi
1826

19-
- name: PHPCS check
20-
uses: chekalsky/phpcs-action@v1
21-
with:
22-
phpcs_bin_path: './vendor/bin/phpcs'
23-
enable_warnings: true
27+
- name: Run phpcs
28+
run: ./vendor/bin/phpcs -q --report=checkstyle src
2429

2530
phpstan:
2631
name: phpstan
2732
runs-on: ubuntu-latest
2833
steps:
2934
- name: Check out code into the workspace
30-
uses: actions/checkout@v2
35+
uses: actions/checkout@v6
36+
with:
37+
persist-credentials: false
3138

3239
- name: Install php
3340
uses: shivammathur/setup-php@v2
3441
with:
3542
php-version: "7.4"
43+
tools: phpstan
3644

3745
- name: Install dependencies
3846
run: composer update --dev --no-interaction --prefer-dist --no-progress --no-suggest --ansi
3947

40-
- name: Require phpstan
41-
run: composer require --dev phpstan/phpstan:"~2.1.56" --no-interaction
42-
4348
- name: Run phpstan
44-
run: php ./vendor/phpstan/phpstan/phpstan.phar analyse --no-progress
49+
run: phpstan analyse --no-progress

.github/workflows/release.yml

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,35 +7,39 @@ on:
77

88
name: Create release
99

10+
permissions: {}
11+
1012
jobs:
1113
build:
1214
name: Create release
1315
runs-on: ubuntu-latest
16+
17+
permissions:
18+
packages: write
19+
contents: write
20+
1421
steps:
1522
- name: Checkout code
16-
uses: actions/checkout@v2
23+
uses: actions/checkout@v6
1724
with:
1825
ref: ${{ github.head_ref }}
26+
1927
- name: Replace version constant
2028
run: |
21-
sed -i "s/VERSION\s*=\s*[^;]*/VERSION = '${{ github.event.inputs.version }}'/g" ./src/Fpdi.php ./src/Tcpdf/Fpdi.php ./src/Tfpdf/Fpdi.php
29+
sed -i "s/VERSION\s*=\s*[^;]*/VERSION = '${NEW_VERSION}'/g" ./src/Fpdi.php ./src/Tcpdf/Fpdi.php ./src/Tfpdf/Fpdi.php
30+
env:
31+
NEW_VERSION: ${{ github.event.inputs.version }}
32+
2233
- name: Commit and push version constant update
23-
uses: stefanzweifel/git-auto-commit-action@v4
34+
uses: stefanzweifel/git-auto-commit-action@v7
2435
with:
2536
commit_message: Updated version constant
2637
push_options: --force
2738

28-
- name: Declare actual commit sha
29-
id: actual_commit_sha
30-
shell: bash
31-
run: echo "::set-output name=sha::$(git rev-parse HEAD)"
3239
- name: Create Release
3340
id: create_release
34-
uses: actions/create-release@v1
41+
run: |
42+
gh release create --draft --title "FPDI ${title}" "v${tag}"
3543
env:
44+
NEW_VERSION: ${{ github.event.inputs.version }}
3645
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37-
with:
38-
commitish: ${{ steps.actual_commit_sha.outputs.sha }}
39-
tag_name: v${{ github.event.inputs.version }}
40-
release_name: FPDI ${{ github.event.inputs.version }}
41-
draft: true

.github/workflows/tests.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: Tests
22
on: [pull_request]
3+
4+
permissions: {}
5+
36
jobs:
47
tests:
58
name: Run PHP Unit tests
@@ -9,7 +12,9 @@ jobs:
912
php: ['7.2', '7.3']
1013
steps:
1114
- name: Checkout
12-
uses: actions/checkout@v2
15+
uses: actions/checkout@v6
16+
with:
17+
persist-credentials: false
1318

1419
- name: Install mupdf and imagemagick
1520
run: sudo apt-get install mupdf-tools imagemagick
@@ -18,6 +23,7 @@ jobs:
1823
uses: shivammathur/setup-php@v2
1924
with:
2025
php-version: "${{ matrix.php }}"
26+
coverage: none
2127

2228
- name: Install dependencies
2329
run: composer update --dev --no-interaction --prefer-dist --no-progress --no-suggest --ansi
@@ -34,7 +40,9 @@ jobs:
3440
php: ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5']
3541
steps:
3642
- name: Checkout
37-
uses: actions/checkout@v2
43+
uses: actions/checkout@v6
44+
with:
45+
persist-credentials: false
3846

3947
- name: Install mupdf and imagemagick
4048
run: sudo apt-get install mupdf-tools imagemagick
@@ -43,6 +51,7 @@ jobs:
4351
uses: shivammathur/setup-php@v2
4452
with:
4553
php-version: "${{ matrix.php }}"
54+
coverage: none
4655

4756
- name: Upgrade phpunit
4857
run: composer require --dev --with-all-dependencies "phpunit/phpunit=^9.0"

.github/workflows/zizmor.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: GitHub Actions Security Analysis with zizmor 🌈
22

33
on:
44
push:
5-
branches: ["main"]
5+
branches: ["master"]
66
pull_request:
77
branches: ["**"]
88

@@ -14,11 +14,9 @@ jobs:
1414
runs-on: ubuntu-latest
1515
permissions:
1616
security-events: write # Required for upload-sarif (used by zizmor-action) to upload SARIF files.
17-
contents: read # Only needed for private repos. Needed to clone the repo.
18-
actions: read # Only needed for private repos. Needed for upload-sarif to read workflow run info.
1917
steps:
2018
- name: Checkout repository
21-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
19+
uses: actions/checkout@v6
2220
with:
2321
persist-credentials: false
2422

.github/zizmor.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
rules:
2+
unpinned-uses:
3+
disable: true

0 commit comments

Comments
 (0)