Skip to content

Actions for PR template #1

Actions for PR template

Actions for PR template #1

Workflow file for this run

name: Add PR Template to Terraform Repos
on:
workflow_dispatch: # Manual trigger
jobs:
batch-update:
runs-on: ubuntu-latest
steps:
- name: Checkout automation repo
uses: actions/checkout@v3
- name: Set up GitHub CLI
uses: cli/cli-action@v2
with:
github-token: ${{ secrets.GH_PAT }}
- name: Add PR Template to Repositories
run: |
REPOS=( "terraform-cloudflare-enterprise-client-certificate"
"terraform-cloudflare-enterprise-zone-mtls"
"terraform-workleap-enterprise-product-foundation"
"terraform-cloudflare-enterprise-zone-waf"
"terraform-azurerm-enterprise-aks"
"terraform-azurerm-enterprise-nsg"
"terraform-azurerm-vertical-foundation"
"terraform-cloudflare-enterprise-zone-config"
"terraform-azurerm-vertical-kubernetes"
"terraform-azurerm-enterprise-vnet"
"terraform-azurerm-enterprise-resource-group"
"terraform-azurerm-enterprise-public-ip"
"terraform-azurerm-enterprise-monitor-vm"
"terraform-azurerm-enterprise-monitor"
"terraform-azurerm-enterprise-machine-learning-workspace"
"terraform-azurerm-enterprise-log-analytics"
"terraform-azurerm-enterprise-keyvault"
"terraform-azurerm-enterprise-defender"
"terraform-azurerm-enterprise-cognitive-account"
"terraform-azurerm-enterprise-application-gateway"
"terraform-azurerm-enterprise-redis"
"terraform-template"
"terraform-cloudflare-enterprise-zone-loadbalancer"
"terraform-cloudflare-enterprise-dns-record"
"terraform-azurerm-naming"
"terraform-azurerm-enterprise-web-app-windows"
"terraform-azurerm-enterprise-keyvault-issued-certificate"
"terraform-azurerm-enterprise-app-insight"
"terraform-azurerm-enterprise-acr"
"terraform-azuread-enterprise-app-registration"
"terraform-secretsmanager-enterprise-generated-secret"
"terraform-secretsmanager-enterprise-manual-secret"
"terraform-azurerm-enterprise-storage-account"
"terraform-azurerm-enterprise-auditing"
"terraform-azurerm-enterprise-prometheus-pod-alerts"
"terraform-zpa-enterprise-zscaler-zpa"
"terraform-azurerm-vertical-compute"
"terraform-azurerm-enterprise-app-configuration"
"terraform-azurerm-enterprise-eventgrid-namespace-event-queue-sub"
"terraform-azurerm-enterprise-eventgrid-namespace"
"terraform-tfe-enterprise-workspace"
"terraform-azurerm-enterprise-eventgrid-topic"
"terraform-azurerm-enterprise-eventhub-namespace"
"terraform-azurerm-enterprise-eventhub"
"terraform-azurerm-enterprise-keyvault-imported-certificate"
"terraform-azurerm-enterprise-postgresql"
"terraform-azurerm-enterprise-app-service-plan"
"terraform-azurerm-enterprise-static-web-site"
"terraform-azurerm-enterprise-function"
"terraform-azurerm-enterprise-keyvault-certificate-issuer"
"terraform-azurerm-enterprise-vm-alerts-linux"
"terraform-azurerm-enterprise-vm-alerts-windows"
"terraform-azurerm-enterprise-api-management"
"terraform-azurerm-enterprise-cdn"
"terraform-provider-vault"
)
PR_BRANCH="add-pr-template"
COMMIT_MSG="chore: add PR template"
PR_TITLE="Add PR Template"
TEMPLATE_CONTENT=$(cat <<'EOF'
### Context & Changes explanation
<!--- Describe the problem or feature in addition to a link to the issues. -->

Check failure on line 83 in .github/workflows/manual.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/manual.yml

Invalid workflow file

You have an error in your yaml syntax on line 83
### General
- [ ] Code follows coding standards and best practices
- [ ] README.md has been updated with relevant changes
- [ ] Module is verified [CIS](https://portal.azure.com/#view/Microsoft_Azure_Policy/InitiativeComplianceDetail.ReactView/assignmentId/%2Fproviders%2Fmicrosoft.management%2Fmanagementgroups%2Fgsoft-group%2Fproviders%2Fmicrosoft.authorization%2Fpolicyassignments%2Fwl-cis-200/initiativeId/%2Fproviders%2Fmicrosoft.authorization%2Fpolicysetdefinitions%2F06f19060-9e68-4070-92ca-f15cc126059e/scopes~/%5B%22%2Fsubscriptions%2F79a9ef18-743b-42b7-ba0a-4414ff9ab4e1%22%2C%22%2Fsubscriptions%2F9c9e4c70-e581-420a-8906-ef2a37e02d94%22%2C%22%2Fsubscriptions%2F7031d23e-23e8-4640-85e0-f2a5098d563e%22%2C%22%2Fsubscriptions%2F6b5e55e0-e02c-42e3-8e3f-8286d8758ecf%22%2C%22%2Fsubscriptions%2Ff94a4ce0-987f-43da-ab3a-4348d602d6ac%22%2C%22%2Fsubscriptions%2F13b79fe4-2472-4e83-8c48-51be287aefe9%22%2C%22%2Fsubscriptions%2Fea15e3bb-3143-4d80-a5fd-bf6f7c1cc94e%22%2C%22%2Fsubscriptions%2F726b8b41-bf7e-4585-9572-e0dc08c9cd58%22%2C%22%2Fsubscriptions%2F2c2ded43-362f-4c86-b68e-82ee954278ec%22%2C%22%2Fsubscriptions%2F859b8f4a-cbad-450d-ab21-7241780044e9%22%5D) compliant
- [ ] Dependencies are up-to-date
EOF
)
for REPO in "${REPOS[@]}"; do
echo "Processing $REPO"
gh repo clone workleap/$REPO
cd $REPO
git checkout -b $PR_BRANCH
mkdir -p .github
echo "$TEMPLATE_CONTENT" > .github/pull_request_template.md
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add .github/pull_request_template.md
git commit -m "$COMMIT_MSG"
git push -u origin $PR_BRANCH
gh pr create --title "$PR_TITLE" \
--body "This PR adds a standardized pull request template." \
--base main
cd ..
done