Contributions are welcome, and they are greatly appreciated! Every little bit helps, and credit will always be given.
Contributions are welcome across the entire project:
- Code
- Documentation
- Testing
- Packaging/distribution
-
Search the issues to see if there is an existing issue. If not, please open one.
-
Fork the repository to your personal namespace (only needed to do this once).
-
Clone the repo from your personal namespace.
git clone https://github.com/{username}/terraform-google-swfw-modules.git
Ensure that{username}
is your user name. -
Add the source repository as an upsteam.
git remote add upstream https://github.com/PaloAltoNetworks/terraform-google-swfw-modules.git
-
Create a branch which corresponds to the issue ID created in step 1.
For example, if the issue ID is 101:
git checkout -b 101-updating-wildfire-templates
-
Make the desired changes and commit to your local repository.
-
Run the
pre-commit
script. See the tools section for more information. NOTE If making changes that will update the Terraform docs, this will need to be run twice. -
Push changes to your repository
git push origin/101-updating-wildfire-templates
-
Rebase with the upstream to resolve any potential conflicts.
git rebase upstream dev
-
Open a Pull Request and link it to the issue (reference the issue, i.e. "fixes #233")
-
Once the PR has been merged, delete your local branch
git branch -D 101-updating-wildfire-templates
-
Search the issues to see if there is an existing issue. If not, open an issue (note the issue ID).
-
Update from the source repository.
git pull upstream dev
-
Create a branch which corresponds to the issue ID created in step 1.
For example, if the issue ID is 101:
git checkout -b 101-updating-wildfire-templates
-
Make any changes, and ensure the commit messages are clear and consistent (reference the issue ID and type of change in all commit messages)
-
Document the changes (update the README and any other relevant documents)
-
Run the
pre-commit
script. See the tools section for more information. NOTE If making changes that will update the Terraform docs, this will need to be run twice. -
Push changes to your repository
git push origin/101-updating-wildfire-templates
-
Rebase with the upstream to resolve any potential conflicts.
git rebase upstream dev
-
Open a Pull Request and link it to the issue (reference the issue, i.e. "fixes #233")
-
Once the PR has been merged, delete your local branch
git branch -D 101-updating-wildfire-templates
Any serious changes, especially any changes of variables or providers, require the
pre-commit
tool. Install the recommended versions:
- pre-commit 2.9.3 - installation instruction (a Python3 package)
- terraform-docs 0.12.1 - download the binary from GitHub releases
- tflint 0.20.2 - download the binary from GitHub releases
- coreutils - required only on macOS (due to use of
realpath
), simply executebrew install coreutils
For more details and a Docker-compatible alternative see the official guide of the author of pre-commit-terraform, Anton Babenko.
For these Contributors who prefer not to use the recommended git hooks, the command to fully update the auto-generated README files and to run formatters/tests:
pre-commit run -a
This command does not commit/add/push any changes to Git. It only changes local files.
The first time pre-commit
is run, it is possible to show "FAILED" if any docs were updated. This is expected behavior. Simply run pre-commit
again and it should pass. Once all pre-commit tests pass, make another commit to check in those changes and push.
Please follow the Terraform conventions.
Testing the workflow requires node, npm, and semantic-release to be installed locally:
npm install -g semantic-release@^17.1.1 @semantic-release/git@^9.0.0 @semantic-release/exec@^5.0.0 conventional-changelog-conventionalcommits@^4.4.0
Run semantic-release
on develop:
semantic-release --dry-run --no-ci --branches=develop
Verify in the output that the next version is set correctly, and the release notes are generated correctly.
git checkout master
git merge develop
git push origin master
At this point, GitHub Actions builds and tags the release.
Now, sync develop to master to add any commits made by the release bot.
git fetch --all --tags
git pull origin master
git checkout develop
git merge master
git push origin develop