-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
feat(ENG-872): adding basic folder structure
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
## Description | ||
|
||
- List of changes related to this PR | ||
|
||
## Issue(s) | ||
|
||
[ENG-###]() | ||
|
||
## How to test | ||
|
||
1. .... | ||
|
||
## Checklist | ||
|
||
- [ ] Something that needs doing |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: YAML Syntax Check | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
lint-yaml: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: "3.x" | ||
|
||
- name: Install yamllint | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install yamllint | ||
- name: Run yamllint | ||
run: yamllint . |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
npm |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"yaml.schemas": { | ||
"https://json.schemastore.org/github-action.json": "/actions/terraform/action.yml" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
### Contributing to Oak Terraform Actions | ||
|
||
Thank you for your interest in contributing to the Oak Terrafor Actions repository! We welcome and appreciate your contributions. Here’s how you can get started: | ||
|
||
## How to Contribute | ||
|
||
1. **Fork the Repository**: Click on the fork button to create your copy of the repository. | ||
2. **Clone Your Fork**: Clone the forked repository to your local machine. | ||
```bash | ||
git clone https://github.com/your-username/oak-terraform-actions.git | ||
``` | ||
3. **Create a Branch**: Create a new branch for your feature or bug fix. | ||
```bash | ||
git checkout -b feature/your-feature-name | ||
``` | ||
4. **Make Changes**: Implement your changes in the new branch. | ||
5. **Commit Changes**: Commit your changes with a meaningful message. | ||
```bash | ||
git commit -m "Add feature: description of feature" | ||
``` | ||
6. **Push Changes**: Push your branch to your fork. | ||
```bash | ||
git push origin feature/your-feature-name | ||
``` | ||
7. **Open a Pull Request**: Go to the original repository and open a pull request from your forked repository. Use the [PR template](#pull-request-template) provided below. | ||
|
||
## Contribution Guidelines | ||
|
||
- **Code Style**: Follow the existing coding style and conventions. | ||
- **Documentation**: Update documentation for any changes or new features. | ||
- **Testing**: Ensure that your code passes all tests and adds new tests if necessary. | ||
- **Review**: Be open to feedback and make changes as requested during the review process. | ||
|
||
## Pull Request Template | ||
|
||
When submitting a pull request, you will be presented with our Pull Request Template. | ||
|
||
### How to Use the Template | ||
|
||
1. **Description**: Clearly list and describe the changes made in this PR. | ||
2. **Issue(s)**: Link any related issues using the `[ENG-###]()` format. | ||
3. **How to test**: Provide step-by-step instructions on how to test the changes. | ||
4. **Checklist**: Ensure all tasks and checks are completed before submitting the PR. | ||
|
||
## Code of Conduct | ||
|
||
Please adhere to the [Code of Conduct](https://github.com/oaknational/oak-terraform-actions/blob/main/CODE_OF_CONDUCT.md) to ensure a welcoming and respectful environment for all contributors. | ||
|
||
## Getting Help | ||
|
||
If you need help, feel free to open an issue or ask for assistance in your pull request. | ||
|
||
> **Tip:** Check out the existing issues for any features or bug fixes you can help with! | ||
We appreciate your contributions and look forward to collaborating with you! 🚀 | ||
|
||
For more details, visit the [Oak Terraform Actions repository](https://github.com/oaknational/oak-terraform-actions). |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,51 @@ | ||
# oak-actions | ||
# oak-terraform-actions | ||
|
||
The `actions` folder is designed to house reusable GitHub Actions for **Terraform**, making it easy to manage and share automation across different repositories. See the Example folder to get started. | ||
|
||
#### Structure | ||
|
||
```plaintext | ||
actions/ | ||
├── terraform-checks/ | ||
│ ├── action.yml | ||
│ ├── scripts/ (if any) | ||
│ └── README.md | ||
``` | ||
|
||
### Terraform Actions 🌍 | ||
|
||
#### Terraform Checks | ||
|
||
**Location:** `actions/terraform-checks` | ||
|
||
**Purpose:** The Terraform Github Action checks your code fits the Oak standards. | ||
|
||
#### Key Features | ||
|
||
- **Infrastructure Management:** Streamlines Terraform commands in CI/CD pipelines. | ||
- **Ease of Use:** Integrates seamlessly with your GitHub workflows. | ||
|
||
### How to Use | ||
|
||
```yaml | ||
# Example Github Workflow file to run Terraform Check action | ||
name: Terraform Checks | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
example-job: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- name: Run Terraform Action from oak-terraform-actions | ||
uses: oaknational/oak-terrform-actions/actions/terraform-checks@main | ||
``` | ||
For more details, visit the [Oak Terraform Actions repository](https://github.com/oaknational/oak-terraform-actions). | ||
# Commits | ||
We're using (husky)[https://github.com/typicode/husky] to create pre-commit hooks with |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--- | ||
name: "Terraform Checks" | ||
description: "Perform common Terraform checks" | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Setup Terraform | ||
uses: hashicorp/setup-terraform@v3 | ||
with: | ||
terraform_version: ${{ inputs.terraform_version }} | ||
|
||
- name: "INFO: Ascertain Terraform Version" | ||
shell: bash | ||
run: terraform --version | ||
|
||
- name: "INFO: Linting Terraform Files" | ||
shell: bash | ||
run: | | ||
cd infrastructure | ||
terraform fmt -check $(find . -name '*tf') | ||
- name: "INFO: Validate Terraform Configs" | ||
shell: bash | ||
run: | | ||
cd infrastructure | ||
for d in $(find . -type d -mindepth 1 -maxdepth 1) | ||
do | ||
echo "Validating the $d config" | ||
cd $d | ||
terraform init -backend=false | ||
terraform validate | ||
cd .. | ||
done |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = { extends: ["@commitlint/config-conventional"] }; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
### Using the Terraform Action from `oaknational/oak-terraform-actions` | ||
|
||
To use the Terraform action from the `oaknational/oak-terraform-actions` repository in your GitHub workflows, follow these steps: | ||
|
||
1. **Create a Workflow File**: In your target repository, create a `.github/workflows` directory if it doesn't exist. | ||
|
||
2. **Add Workflow Configuration**: Create a workflow file (e.g., `main.yml`) with the following content: | ||
|
||
```yaml | ||
name: oak-terraform-action | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
example-job: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Run Terraform Action from oak-terraform-actions | ||
uses: oaknational/oak-terraform-actions/actions/terraform@main | ||
with: | ||
example_input: "value" | ||
``` | ||
### Explanation | ||
- **uses: oaknational/oak-terraform-actions/actions/terraform@main**: Specifies the action from the `oak-terraform-actions` repository. | ||
- **example_input**: Replace this with the actual input parameters required by the Terraform action 😉. | ||
|
||
This setup allows you to incorporate the reusable Terraform action in your CI/CD workflows. For more details, visit the [oaknational/oak-terraform-actions repository](https://github.com/oaknational/oak-terraform-actions). |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Example Github Workflow file to run Terraform Check action | ||
name: Terraform Checks | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
example-job: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- name: Run Terraform Action from oak-terraform-actions | ||
uses: oaknational/oak-terrform-actions/actions/terraform-checks@main |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.