Skip to content

Commit 049162e

Browse files
authored
Merge pull request #14 from recognizegroup/develop
Initial release
2 parents 5896aeb + 2c82c24 commit 049162e

File tree

6 files changed

+177
-1
lines changed

6 files changed

+177
-1
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Setup dependencies
2+
description: Setup dependencies required to run pipeline
3+
inputs:
4+
git_token:
5+
required: true
6+
description: "Team orange git token"
7+
8+
runs:
9+
using: "composite"
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v3
13+
- name: Git token to git url
14+
run: git config --global url."https://oauth2:${{ inputs.git_token }}@github.com/recognizegroup".insteadOf https://github.com/recognizegroup
15+
shell: bash
16+
- run: echo "/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin" >> $GITHUB_PATH
17+
shell: bash
18+
19+
- name: Setup
20+
run: |
21+
wget https://github.com/gruntwork-io/terragrunt/releases/download/v0.84.1/terragrunt_linux_amd64
22+
mv terragrunt_linux_amd64 terragrunt
23+
chmod +x terragrunt
24+
mv terragrunt /usr/local/bin
25+
shell: bash
26+
27+
- name: Setup
28+
run: |
29+
mkdir -p tmp
30+
cd tmp
31+
wget https://releases.hashicorp.com/terraform/1.12.2/terraform_1.12.2_linux_amd64.zip
32+
unzip -o terraform_1.12.2_linux_amd64.zip
33+
chmod +x terraform
34+
mv terraform /usr/local/bin
35+
shell: bash
36+
- name: Versions
37+
run: |
38+
terragrunt -v
39+
terraform --version
40+
shell: bash
41+
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Terragrunt Apply
2+
description: Runs Terragrunt apply and reports failure if occurs
3+
inputs:
4+
webhook:
5+
required: true
6+
description: "teams webhook"
7+
terragrunt_download_directory:
8+
required: true
9+
description: "Terragrunt download directory"
10+
working_directory:
11+
required: false
12+
default: .
13+
description: "Location where to execute terragrunt apply command"
14+
15+
runs:
16+
using: composite
17+
steps:
18+
- name: Create Terraform Download Directory
19+
run: |
20+
rm -r ${{ inputs.terragrunt_download_directory }}/* --force
21+
mkdir --parents ${{ inputs.terragrunt_download_directory }}
22+
working-directory: ${{ inputs.working_directory }}
23+
shell: bash
24+
- name: Terragrunt Apply
25+
run: |
26+
terragrunt run-all apply --non-interactive --terragrunt-parallelism 5
27+
working-directory: ${{ inputs.working_directory }}
28+
shell: bash
29+
- name: Notify about failures
30+
if: ${{ failure() }}
31+
run: |
32+
cat << EOF > message.json
33+
{"@type":"MessageCard","@context":"https://schema.org/extensions","summary":"Pipeline failed!","themeColor":"ff0000","title":"$GITHUB_REPOSITORY pipeline failed 💢!","sections":[{"facts":[{"name":"Repository:","value":"$GITHUB_REPOSITORY"},{"name":"Branch:","value":"$GITHUB_REF_NAME"},{"name":"Commit:","value":"$GITHUB_SHA"}]}],"potentialAction":[{"@type":"OpenUri","name":"View on GitHub","targets":[{"os":"default","uri":"$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID"}]}]}
34+
EOF
35+
curl -X POST ${{ inputs.webhook }} --header 'Content-Type: application/json' -d @message.json
36+
shell: bash
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: "Dummy Code Scanning"
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 * * 1'
6+
workflow_dispatch:
7+
8+
jobs:
9+
code-scanning-dummy:
10+
name: Perform code scanning (Dummy)
11+
uses: recognizegroup/security/.github/workflows/code-scanning-dummy.yaml@v2
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: PR Title Checker
2+
on:
3+
workflow_call:
4+
pull_request:
5+
branches:
6+
- develop
7+
types:
8+
- opened
9+
- edited
10+
- synchronize
11+
12+
jobs:
13+
check-pr-title:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: Slashgear/action-check-pr-title@v4.3.0
17+
with:
18+
regexp: ".*(ab|AB)#[0-9]+.*" # Regex the title should match ab#(number) or AB#(number).
19+
helpMessage: "PR title check failed: AB# must be included somewhere in the PR title!'"

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#Rider
2+
.idea
3+
4+
.vs/

README.md

Lines changed: 66 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,66 @@
1-
# vwt-ip-action-modules
1+
# vwt-ip-action-modules
2+
These are actions which are used in our workflows.
3+
# Actions
4+
### Brew and git action
5+
##### Input parameters
6+
- git_token (this is a token required to allow data modules to be imported)
7+
8+
##### Example of use brew and git
9+
```yaml
10+
- name: Setup git token and brew
11+
id: brew_and_git
12+
uses: recognizegroup/vwt-ip-action-modules/.github/actions/brew_and_gittoken@{desired version}
13+
with:
14+
git_token: ${{ secrets.TEAM_ORANGE_GIT_TOKEN }}
15+
```
16+
17+
### Terragrunt apply
18+
##### Input parameters
19+
- webhook (Webhook is used for notifying when terragrunt apply fails)
20+
##### Example of use terragrunt apply
21+
22+
By the environement parameters you should set directory the
23+
24+
- TERRAGRUNT_DOWNLOAD:
25+
- TF_PLUGIN_CACHE_DIR
26+
27+
example with environment
28+
29+
```yaml
30+
env:
31+
TERRAGRUNT_DOWNLOAD: ${{ github.workspace }}/.terragrunt
32+
TF_PLUGIN_CACHE_DIR: ${{ github.workspace }}/.terragrunt/plugin-cache
33+
```
34+
35+
Under steps add
36+
37+
```yaml
38+
- name: Terragrunt apply
39+
id: terragrunt_apply
40+
uses: recognizegroup/vwt-ip-action-modules/.github/actions/terragrunt_apply@{desired version}
41+
with:
42+
webhook: ${{ secrets.TEAMS_WEBHOOK_URL }}
43+
terragrunt_download_directory: $TERRAGRUNT_DOWNLOAD
44+
tf_plugin_directory: $TF_PLUGIN_CACHE_DIR
45+
```
46+
47+
# Workflows
48+
49+
#### Pr title check
50+
51+
```yaml
52+
name: PR Title Checker
53+
on:
54+
pull_request:
55+
branches:
56+
- develop
57+
types:
58+
- opened
59+
- edited
60+
- synchronize
61+
62+
jobs:
63+
check-pr-title:
64+
uses: recognizegroup/vwt-ip-action-modules/.github/workflows/pull_request_title.yaml@{desired version}
65+
```
66+

0 commit comments

Comments
 (0)