Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/workflows/reusable-findtokenprops.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: FindTokenPropertiesRefs

on:
workflow_call:

jobs:
find-token-properties:
# The properties in the PHPCS Tokens class have been deprecated since PHPCS 4.0.0.
name: 'Find use of Tokens properties'
runs-on: windows-latest

steps:
- name: Checkout code
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false

- name: Find uses
id: findprops
shell: cmd
run: |
findstr /S /N /C:"Tokens::$" *.php
IF %ERRORLEVEL% NEQ 1 (Echo Please use the Tokens constants instead of the properties &Exit /b 1)
IF %ERRORLEVEL% EQU 1 (Echo All good &Exit /b 0)
29 changes: 17 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Additional community health files may be added over time and/or when GitHub adds

## Re-usable workflows

Aside from the community health files, this repository also offers a number of configuration file driven re-usable GitHub Actions workflows.
Aside from the community health files, this repository also offers a number of (mostly) configuration file driven re-usable GitHub Actions workflows.

### What does "configuration file driven" mean and why are the workflows set up that way ?

Expand Down Expand Up @@ -49,7 +49,10 @@ The following re-usable workflows are available:
**Inputs**:
+ `strict`: Optional. Whether to enable strict mode. Defaults to "false".
2. [actionlint] which runs a static analysis check on GitHub Actions workflow files only.
_Note: this is the only check without a configuration file requirement._
_Note: this check does not have a configuration file requirement._
* [`reusable-findtokenprops.yml`][reusable-findtokenprops] to find any uses of the PHPCS static `Tokens::$groupName` properties.
These properties have been (soft) deprecated since PHP_CodeSniffer 4.0.0 and should no longer be used in code bases which have dropped support for PHP_CodeSniffer 3.x.
_Note: this check does not have a configuration file requirement._

Example configuration files for most of these can be found in the root directory of this repository.

Expand All @@ -70,17 +73,19 @@ This has two benefits:
> It is best practice for tags for repositories which will be used in GitHub Actions workflows to be prefixed with `v` before the version number, so tags in this repository should start with a `v` prefix too.


[community health files]: https://docs.github.com/en/communities/setting-up-your-project-for-healthy-contributions/creating-a-default-community-health-file
[community health files]: https://docs.github.com/en/communities/setting-up-your-project-for-healthy-contributions/creating-a-default-community-health-file

[reusable-markdownlint]: https://github.com/PHPCSStandards/.github/blob/main/.github/workflows/reusable-markdownlint.yml
[markdownlint-cli2]: https://github.com/DavidAnson/markdownlint-cli2
[reusable-markdownlint]: https://github.com/PHPCSStandards/.github/blob/main/.github/workflows/reusable-markdownlint.yml
Comment thread
fredden marked this conversation as resolved.
[markdownlint-cli2]: https://github.com/DavidAnson/markdownlint-cli2

[reusable-phpstan]: https://github.com/PHPCSStandards/.github/blob/main/.github/workflows/reusable-phpstan.yml
[phpstan]: https://phpstan.org/
[reusable-phpstan]: https://github.com/PHPCSStandards/.github/blob/main/.github/workflows/reusable-phpstan.yml
[phpstan]: https://phpstan.org/

[reusable-remark]: https://github.com/PHPCSStandards/.github/blob/main/.github/workflows/reusable-remark.yml
[remark-lint]: https://github.com/remarkjs/remark-lint
[reusable-remark]: https://github.com/PHPCSStandards/.github/blob/main/.github/workflows/reusable-remark.yml
[remark-lint]: https://github.com/remarkjs/remark-lint

[reusable-yamllint]: https://github.com/PHPCSStandards/.github/blob/main/.github/workflows/reusable-yamllint.yml
[yamllint]: https://yamllint.readthedocs.io/en/stable/
[actionlint]: https://github.com/rhysd/actionlint
[reusable-yamllint]: https://github.com/PHPCSStandards/.github/blob/main/.github/workflows/reusable-yamllint.yml
[yamllint]: https://yamllint.readthedocs.io/en/stable/
[actionlint]: https://github.com/rhysd/actionlint

[reusable-findtokenprops]: https://github.com/PHPCSStandards/.github/blob/main/.github/workflows/reusable-findtokenprops.yml
Loading