The vmware-image-builder-action project team welcomes contributions from the community. Before you start working with vmware-image-builder-action, please read our Developer Certificate of Origin. All contributions to this repository must be signed as described on that page. Your signature certifies that you wrote the patch or have the right to pass it on as an open-source patch.
This is a rough outline of what a contributor's workflow looks like:
- Create a topic branch from where you want to base your work
- Make commits of logical units
- Make sure your commit messages are in the proper format (see below)
- Push your changes to a topic branch in your fork of the repository
- Submit a pull request
Example:
git remote add upstream https://github.com/vmware-labs/vmware-image-builder-action.git
git checkout -b my-new-feature main
git commit -a
git push origin my-new-feature
When your branch gets out of sync with the vmware-labs/main branch, use the following to update:
git checkout my-new-feature
git fetch -a
git pull --rebase upstream main
git push --force-with-lease origin my-new-feature
If your PR fails to pass CI or needs changes based on code review, you'll most likely want to squash these changes into existing commits.
If your pull request contains a single commit or your changes are related to the most recent commit, you can simply amend the commit.
git add .
git commit --amend
git push --force-with-lease origin my-new-feature
If you need to squash changes into an earlier commit, you can use:
git add .
git commit --fixup <commit>
git rebase -i --autosquash main
git push --force-with-lease origin my-new-feature
Be sure to add a comment to the PR indicating your new changes are ready to review, as GitHub does not generate a notification when you git push.
We follow the conventions on How to Write a Git Commit Message.
Be sure to include any related GitHub issue references in the commit message. See GFM syntax for referencing issues and commits.
We do use Prettier as a tool to ensure a consistent format. A format check step runs as part of our continuous integration and pull requests get failed checks if they don't adhere to the conventions. To make sure your contribution is properly formatted you can run the following:
npm run format-check
The format
script can also be used to make prettier automatically apply the format guidelines:
npm run format
As part of our continuous integration workflow we do pass ESlint to all pull requests. To make sure that your contribution passes all the static checks you can use:
npm run lint
We value highly-tested software. All pull requests should come accompanied by corresponding unit tests. Integration tests are also welcomed. To make sure that your contribution isn't causing any regression we run the test suite as part of our continuous integration process. You should also make sure that all the tests pass before sending your pull request:
npm run test
All stable code is hosted at the main
branch. Release and version management is fully automated and based in commit messages that follow a subset of the Conventional Commits spec. Based on the commit message, our continuous integration pipeline will automatically build, package and version bump and tag the codebase.
Versioning follows the semver spec and the appropriate patch, minor or major version is bumped depending on the commit messages. Here is the convention used for version bumping based on the commit messages:
- If the strings "BREAKING CHANGE", "major" are found anywhere in any of the commit messages or descriptions the major version will be incremented.
- If a commit message begins with the string "feat" or includes "minor" then the minor version will be increased. This works for most common commit metadata for feature additions: "feat: new API" and "feature: new API".
- All other changes will increment the patch version.
Once version is bumped in package.json and package-lock.json files, these files will be pushed into repository. Then a new tag will be pushed for the new version back into the repo.
In addition to version bumping, our continuous integration script will build and package the GitHub Action before pushing the changes to the main branch.
Upon any major release and sometimes with minor releases that might be needed by customers we will be promoting our releases to the GitHub Marketplace. Unfortunately, GitHub is not providing any automation for publishing GitHub Actions into their marketplace so this will essentially be a manual process until automation support is provided by their platform.
When opening a new issue, try to roughly follow the commit message format conventions above.