You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+14-15Lines changed: 14 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,13 +6,13 @@ Use the PHP Prefixer CLI in your Github Actions
6
6
7
7
The **PHP Prefixer Build Action** integrates the [PHP-Prefixer](https://php-prefixer.com/) service with GitHub Actions.
8
8
9
-
**PHP-Prefixer** is a service to apply PHP prefixes to namespaces, functions, helpers, traits, interfaces, etc. Start with a Composer project and a set of dependencies, and prefix all library files at once to generate a consistent prefixed codebase.
9
+
**PHP-Prefixer** is a service to apply PHP prefixes to namespaces, functions, helpers, traits, interfaces, etc. You start with with a Composer project and a set of dependencies, and prefix all library files at once to generate a consistent prefixed codebase.
10
10
11
-
PHP-Prefixer abstracts the complexity of manually applying prefixes to PHP files. The service **automates and streamlines the process of prefixing**with the scalability and simplicity of serverless computing.
11
+
PHP-Prefixer abstracts the complexity of manually applying prefixes to PHP files. The service **automates and streamlines the process of prefixing**while providing the scalability and simplicity of serverless computing.
12
12
13
13
PHP-Prefixer is a **rule-based expert system** that processes the project and dependencies iteratively to prefix every project file.
14
14
15
-
Given this sample class declaration:
15
+
Here is a sample class declaration:
16
16
17
17
```php
18
18
namespace ACME\Carbon;
@@ -42,13 +42,13 @@ class Carbon extends DateTime
42
42
...
43
43
```
44
44
45
-
An example repository has been created at https://github.com/PHP-Prefixer/hello-wp-world to show how to use this action in a real project. The repository also depends on a private dependency and uses GitHub PAT/Personal Access Tokens for authentication.
45
+
An example repository has been created at https://github.com/PHP-Prefixer/hello-wp-world to show how to use this Action in a real project. The repository depends on a private dependency and uses GitHub PAT/Personal Access Tokens for authentication.
46
46
47
47
## Usage
48
48
49
-
To use the Action, you must create an account on [PHP-Prefixer](https://php-prefixer.com/) and prepare your projects with the prefix defined in the `composer.json` schema. Before using the Action and the command-line, we recommend checking the documentation and guides here: <https://php-prefixer.com/docs/>. You can also prefix your firsts projects on the service web interface, and in a second step, integrate Action in your repositories.
49
+
To use the Action, you must create an account on [PHP-Prefixer](https://php-prefixer.com/) and prepare your projects with the prefix defined in the `composer.json` schema. Before using the Action and the command-line, we recommend checking the documentation and guides here: <https://php-prefixer.com/docs/>. You can first prefix your project on the service web interface, and then integrate Action in your repositories.
50
50
51
-
Create your Github Workflow configuration in `.github/workflows/prefixer.yml` or similar.
51
+
Create your Github Workflow configuration in `.github/workflows/prefixer.yml`.
PERSONAL_ACCESS_TOKEN | The PHP-Prefixer PAT/Personal Access Token. The token must be configured in the PHP-Prefixer account. | Yes | `789\|123456789...`
83
83
PROJECT_ID | The project ID to process the source code. The project must be configured in your account in the PHP-Prefixer account. | Yes | `5432`
84
-
SOURCE_DIR_PATH | The relative path to the source project directory. It must contain a .git repository and composer.json file. If not, set the base repository directory will be used as the value. Example: `foo/bar`. | No | `./`
84
+
SOURCE_DIR_PATH | The relative path to the source project directory. It must contain a .git repository and composer.json file. If not, the base repository directory will be used as the value. Example: `foo/bar`. | No | `./`
85
85
TARGET_BRANCH | The branch in the repository where PHP-Prefixer will store the prefixed files after processing. Default value: `prefixed`. | No |
86
86
GH_PERSONAL_ACCESS_TOKEN | The GitHub PAT/Personal Access Token to access private repositories. It is only required if the project, the library or the dependencies are private. | No | `ghp_F4fZ9Cq7QF...`
87
87
88
88
## Prefixing Private Repositories
89
89
90
-
To prefix from a private repository, GitHub PAT/Personal Access Tokens must be used. Generate a **Personal Access Token** for this purpose and add it to your private repository's configuration.
90
+
Follow these steps to prefix private repositories:
91
91
92
-
Create a [Personal Access Token](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token) for the Github account you wish to authenticate with.
92
+
- Step 1: Create a GitHub [Personal Access Token](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token) for the Github account you wish to authenticate with.
93
+
- Step 2: Next, add the GitHub Personal Access Token to your project using [Github Secrets](https://docs.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets), and pass it into the Action using the input.
93
94
94
-
Add the GitHub PAT/Personal Access Tokens to your project using [Github Secrets][secrets], and pass them into the `PHP-Prefixer/php-prefixer-build-action` action by using the `gh_personal_access_token` input.
There is an example repository available for reference at https://github.com/PHP-Prefixer/hello-wp-world that uses a private dependency. Check it out for a live working project.
113
+
There is an example repository available for reference at https://github.com/PHP-Prefixer/hello-wp-world that uses a private dependency. Check it out for a live project.
115
114
116
115
## Version Numbers
117
116
118
-
This action is released with semantic version numbers and tagged, so the latest major release's tag always points to the latest release within the matching major version.
117
+
This Action is released with semantic version numbers and tags. The latest major release's tag always points to the latest release within the matching major version.
119
118
120
-
Please feel free to use `uses: PHP-Prefixer/php-prefixer-build-action@v1` to always run the latest version of v1, or `uses: PHP-Prefixer/php-prefixer-build-action@v1.0.0` to specify the exact release.
119
+
Please feel free to use `uses: PHP-Prefixer/php-prefixer-build-action@v1` to run the latest version of v1, or `uses: PHP-Prefixer/php-prefixer-build-action@v1.0.0` to specify the exact Action’s version.
Copy file name to clipboardExpand all lines: action.yml
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ inputs:
12
12
required: true
13
13
14
14
source_dir_path:
15
-
description: 'The relative path to the source project directory. It must contain a .git repository and composer.json file. If not, set the base repository directory will be used as the value. Example: `foo/bar`.'
15
+
description: 'The relative path to the source project directory. It must contain a .git repository and composer.json file. If not, the base repository directory will be used as the value. Example: `foo/bar`.'
0 commit comments