equinor/terraform-baseline

Add contributing guidelines and security policy

Closed this issue · 0 comments

Run the following script to automatically create PRs for all modules:

#! /bin/bash

set -eu

modules=(
  "acr"
  "app-config"
  "app-insights"
  "automation"
  "databricks"
  "event-grid"
  "function-app"
  "grafana"
  "identity"
  "key-vault"
  "log-analytics"
  "network"
  "nat"
  "postgres"
  "public-ip"
  "service-bus"
  "sql"
  "storage"
  "web-app"
)

for module in "${modules[@]}"; do
  # Clone repo
  repo="terraform-azurerm-$module"
  git clone "https://github.com/equinor/$repo.git"
  cd "$repo"

  # Create new branch and make changes
  branch="chore-add-contributing-guidelines-and-security-policy"
  git switch -c "$branch"
  printf "# Contributing guidelines\n\nThis project has adopted the [Equinor Terraform Baseline contributing guidelines](https://github.com/equinor/terraform-baseline/blob/main/CONTRIBUTING.md).\n" > CONTRIBUTING.md
  printf "# Security policy\n\nThis project has adopted the [Equinor Terraform Baseline security policy](https://github.com/equinor/terraform-baseline/blob/main/SECURITY.md).\n" > SECURITY.md
  printf "\n## Contributing\n\nSee [Contributing guidelines](CONTRIBUTING.md).\n" >> README.md

  # Commit changes and create PR
  commit_message="docs: add contributing guidelines and security policy"
  git add CONTRIBUTING.md SECURITY.md README.md
  git commit -m "$commit_message"
  git push
  gh pr create --title "$commit_message" --body ""

  # Delete local repo
  cd ..
  rm -rf "$repo"
done

Contributing guidelines

Security policy