10up / wpcs-action

GitHub Action to help you lint your PHP without additional dependencies within your codebase
MIT License
54 stars 13 forks source link

Change from using `master` branch to the 2.3.0 tag #34

Closed dkotter closed 1 year ago

dkotter commented 1 year ago

Description of the Change

The WordPress Coding Standards repo has removed the use of the master branch and have gone with main branch instead. This repo has a call to clone the master branch, which is currently failing. This PR fixes that by switching to use the latest tagged release, 2.3.0.

Once version 3.0.0 of WPCS is released, we should test that version with this tool to ensure everything works. If so, we should either switch to that tag or switch to using the main branch (which allows us to ensure the latest version is always pulled in).

Closes #33

How to test the Change

Locally, run the following line to see the error:

git clone -b master https://github.com/WordPress/WordPress-Coding-Standards.git ~/wpcs

Then run the new line to ensure it works:

git clone --depth 1 -b 2.3.0 https://github.com/WordPress/WordPress-Coding-Standards.git ~/wpcs

Changelog Entry

Fixed - Clone the 2.3.0 tagged branch of the WordPress Coding Standards

Credits

Props @dkotter

Checklist:

GaryJones commented 1 year ago

Since WordPressCS 3.0 is about to be released, which may break the workflow, it may be worth making the checkout to use 2.3.0, and then intentionally test the 3.0.0 WordPressCS release, and release that as a new version of this action.

dkotter commented 1 year ago

Since WordPressCS 3.0 is about to be released, which may break the workflow, it may be worth making the checkout to use 2.3.0, and then intentionally test the 3.0.0 WordPressCS release, and release that as a new version of this action.

That's a good point and I've made that change now. I think the only downside to this is now anyone using this action won't automatically get the latest changes to the WPCS library as it's fixed to a specific version. But does mean we don't have to worry about failures like this happening in the future.

My thought is once 3.0.0 is released, at the very least we update to pull in that version (and fix any issues that may occur) but maybe also consider going back to cloning the main branch, which would mean any project using this will get the latest updates when this tool is run.

GaryJones commented 1 year ago

For WordPressCS 3.0, installation via Composer is the only supported method. Is there any reason why git clones are used here?

dkotter commented 1 year ago

For WordPressCS 3.0, installation via Composer is the only supported method. Is there any reason why git clones are used here?

I don't know the historical reason why this is done the way it's done but we can definitely look to update this once we fully support 3.0