|
14 | 14 | # Allow running this workflow manually from the Actions tab.
|
15 | 15 | workflow_dispatch:
|
16 | 16 | # Allow this workflow to be triggered from outside.
|
| 17 | + repository_dispatch: |
| 18 | + types: |
| 19 | + - 'phpcs-release' |
17 | 20 |
|
18 | 21 | # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
|
19 | 22 | # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
|
|
38 | 41 | - name: Checkout code
|
39 | 42 | uses: actions/checkout@v4
|
40 | 43 |
|
| 44 | + - name: Install PHP |
| 45 | + uses: shivammathur/setup-php@v2 |
| 46 | + with: |
| 47 | + php-version: 'latest' |
| 48 | + ini-values: error_reporting=-1, display_errors=On, log_errors_max_len=0 |
| 49 | + tools: phpcs, phpcbf |
| 50 | + coverage: none |
| 51 | + |
| 52 | + # Make sure we've gotten the latest PHPCS version from setup-php. |
| 53 | + - name: Retrieve latest release info |
| 54 | + |
| 55 | + id: get_latest_release |
| 56 | + with: |
| 57 | + route: GET /repos/PHPCSStandards/PHP_CodeSniffer/releases/latest |
| 58 | + env: |
| 59 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 60 | + |
| 61 | + - name: Grab latest tag name from API response |
| 62 | + id: latest_version |
| 63 | + run: | |
| 64 | + echo "TAG=${{ fromJson(steps.get_latest_release.outputs.data).tag_name }}" >> "$GITHUB_OUTPUT" |
| 65 | +
|
| 66 | + - name: Grab the version |
| 67 | + id: phar_version |
| 68 | + # yamllint disable-line rule:line-length |
| 69 | + run: echo "VERSION=$(phpcs --version | grep --only-matching --max-count=1 --extended-regexp '\b[0-9]+(\.[0-9]+)+')" >> "$GITHUB_OUTPUT" |
| 70 | + |
| 71 | + - name: Fail the build if the PHAR is not the correct version |
| 72 | + if: ${{ steps.phar_version.outputs.VERSION != steps.latest_version.outputs.TAG }} |
| 73 | + run: exit 1 |
| 74 | + |
41 | 75 |
|
42 | 76 | # ################################################################################
|
43 | 77 | # Update Wiki files.
|
|
94 | 128 | A dry-run has been executed on your PR, executing all markdown pre-processing for the wiki files.
|
95 | 129 |
|
96 | 130 | Please review the resulting final markdown files via the [created artifact](${{ steps.artifact.outputs.artifact-url }}).
|
97 |
| - This is especially important when adding new pages. |
| 131 | + This is especially important when adding new pages or updating auto-generated output blocks. |
98 | 132 |
|
99 | 133 | _N.B.: the above link will automatically be updated when this PR is updated._
|
100 | 134 |
|
|
0 commit comments