As a contributor, here are the guidelines you should follow:
- Use the issue tracker to make sure the feature request or bug has not been already reported 🔎.
- Submit an issue describing your proposed change to the repo 💡.
- The repo owner will respond to your issue as soon as we can 💪.
- If your proposal change is accepted, fork the repo, develop and test your code changes 🤝.
- Ensure that your code adheres to the existing style in the code 💅🏻.
- Title your pull request following Conventional Commits styling 🪄.
Here we are going to describe all you should know when developing in this action.
This project is configured to use pnpm as package manager, so you should have it installed in your machine. If you don't have it, you can install it running:
npm install -g pnpm@9.14.2In the next step, you need to configure the node environment, we recommend to use nvm for it, but you can use another tool like fnm or other:
nvm install
nvm useDue to the nature of this GitHub action, the code we are running is located under the dist folder. To generate this folder you need to run:
pnpm buildBefore pushing our changes is recommended to run this command, we will see the dist folder has changed with our new code, don't worry, this is not a mistake is how this action works, just commit this change and push.
In case you don't commit the dist folder, our CI/CD workflows will detect this mismatch and will suggest you some ways to fix it, automatically and manually.
If you want to run the tests we have associated to the action, you can run:
pnpm testIf you want to run the linter, you can execute:
pnpm lintIf you want to run the action locally, we recommend the usage of act.
To install it on mac, you can run:
brew install actNow, you can run the action with act executing:
act -W '.github/workflows/github-action-template.yml' --container-architecture linux/amd64Once we push our code, we will see it will be executed the action we are developing, in this way we can test that everything is working fine, this workflow is located under .github/workflows/github-action-template.yml. You don't need to change this file, it will run automatically with the changes you are doing.
In case you want to test this action in a separated repository, you can use the branch name as tag, so you will be able to point to: AlbertHernandez/github-action-nodejs-template@<branch-name>.
The process of creating the final version is fully automatized, you just need to merge into the main branch using conventional commits.
Here, our CI/CD will start doing some magic and we will:
- Create the tag (the three versions:
v<major>,v<major>.<minor>andv<major>.<minor>.<patch>). - Update the changelog.
- Create the release.