forked from Michael-Burbank/Terraform
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
39 lines (36 loc) · 1.52 KB
/
Copy path.gitlab-ci.yml
File metadata and controls
39 lines (36 loc) · 1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# You can override the included template(s) by including variable overrides
# SAST customization: https://docs.gitlab.com/user/application_security/sast/#available-cicd-variables
# Secret Detection customization: https://docs.gitlab.com/user/application_security/secret_detection/pipeline/configure/
# Dependency Scanning customization: https://docs.gitlab.com/user/application_security/dependency_scanning/#customizing-analyzer-behavior
# Container Scanning customization: https://docs.gitlab.com/user/application_security/container_scanning/#customizing-analyzer-behavior
# Note that environment variables can be set in several places
# See https://docs.gitlab.com/ci/variables/#cicd-variable-precedence
include:
- template: Security/SAST.gitlab-ci.yml
- template: Security/Secret-Detection.gitlab-ci.yml
variables:
SECRET_DETECTION_ENABLED: "true"
GIT_DEPTH: 0
stages:
- test
- secret-detection
- ci
github:
stage: ci
script:
- echo "Pushing to GitHub repository..."
- |
git config user.name "Michael-Burbank"
git config user.email "Mike.W.Burbank@Gmail.com"
- |
if git remote | grep github; then
git remote set-url github "https://${GITHUB_TOKEN}@github.com/Michael-Burbank/Terraform.git"
else
git remote add github "https://${GITHUB_TOKEN}@github.com/Michael-Burbank/Terraform.git"
fi
- git checkout -b main || git checkout main
- git push github main
- echo "Pushed to GitHub repository."
rules:
- if: '$CI_COMMIT_BRANCH == "main"'
when: always