Skip to content

Commit 138a3b6

Browse files
author
EC2 Default User
committed
Update GitHub workflows with App token
1 parent 315ca69 commit 138a3b6

File tree

3 files changed

+93
-85
lines changed

3 files changed

+93
-85
lines changed

.github/workflows/mysql-version-check.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
name: Block MySQL 5.x Usage
2-
32
on:
43
pull_request:
54
branches:
65
- develop
7-
86
jobs:
97
mysql-check:
108
runs-on:
119
labels: self-hosted
12-
1310
steps:
11+
- name: Create GitHub App token
12+
id: github-app-token
13+
uses: actions/create-github-app-token@v2
14+
with:
15+
app-id: ${{ secrets.InsiderActionsApplication_APP_ID }}
16+
private-key: ${{ secrets.InsiderActionsApplication_PRIVATE_KEY }}
1417
- name: Checkout code
1518
uses: actions/checkout@v4
16-
1719
- name: Check for MySQL 5.x
1820
run: |
1921
echo "Scanning for MySQL 5.x usage..."
@@ -30,4 +32,4 @@ jobs:
3032
exit 1
3133
else
3234
echo "No MySQL 5.x usage found."
33-
fi
35+
fi

.github/workflows/readme.yml

Lines changed: 24 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,52 @@
1-
name: 'Create README.md file'
1+
name: Create README.md file
22
on:
33
push:
44
branches:
55
- master
6-
76
jobs:
87
readme-create:
9-
name: 'readme-create'
8+
name: readme-create
109
runs-on: ubuntu-latest
1110
steps:
12-
- name: 'Checkout'
11+
- name: Create GitHub App token
12+
id: github-app-token
13+
uses: actions/create-github-app-token@v2
14+
with:
15+
app-id: ${{ secrets.InsiderActionsApplication_APP_ID }}
16+
private-key: ${{ secrets.InsiderActionsApplication_PRIVATE_KEY }}
17+
- name: Checkout
1318
uses: actions/[email protected]
14-
15-
- name: 'Set up Python 3.7'
19+
- name: Set up Python 3.7
1620
uses: actions/setup-python@v2
1721
with:
18-
python-version: '3.x'
19-
20-
- name: 'create readme'
21-
uses: 'clouddrove/[email protected]'
22+
python-version: 3.x
23+
- name: create readme
24+
uses: clouddrove/[email protected]
2225
with:
23-
actions_subcommand: 'readme'
24-
github_token: '${{ secrets.GITHUB}}'
26+
actions_subcommand: readme
27+
github_token: ${{ secrets.GITHUB}}
2528
env:
2629
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN}}
27-
28-
29-
- name: 'pre-commit check errors'
30+
- name: pre-commit check errors
3031
uses: pre-commit/[email protected]
3132
continue-on-error: true
32-
33-
- name: 'pre-commit fix errors'
33+
- name: pre-commit fix errors
3434
uses: pre-commit/[email protected]
3535
continue-on-error: true
36-
37-
- name: 'push readme'
38-
uses: 'clouddrove/[email protected]'
36+
- name: push readme
37+
uses: clouddrove/[email protected]
3938
continue-on-error: true
4039
with:
41-
actions_subcommand: 'push'
40+
actions_subcommand: push
4241
env:
4342
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN}}
44-
45-
- name: 'Slack Notification'
43+
- name: Slack Notification
4644
uses: clouddrove/action-slack@v2
4745
with:
4846
status: ${{ job.status }}
4947
fields: repo,author
50-
author_name: 'CloudDrove'
48+
author_name: CloudDrove
5149
env:
52-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # required
53-
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_TERRAFORM }} # required
50+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
51+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_TERRAFORM }}
5452
if: always()

.github/workflows/terraform.yml

Lines changed: 62 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,111 +1,119 @@
1-
name: 'Terraform GitHub Actions'
1+
name: Terraform GitHub Actions
22
on:
33
pull_request:
44
branches:
55
- master
6-
76
jobs:
87
fmt:
9-
name: 'terraform fmt'
8+
name: terraform fmt
109
runs-on: ubuntu-latest
1110
steps:
12-
- name: 'Checkout'
11+
- name: Create GitHub App token
12+
id: github-app-token
13+
uses: actions/create-github-app-token@v2
14+
with:
15+
app-id: ${{ secrets.InsiderActionsApplication_APP_ID }}
16+
private-key: ${{ secrets.InsiderActionsApplication_PRIVATE_KEY }}
17+
- name: Checkout
1318
uses: actions/[email protected]
14-
15-
- name: 'Terraform Format'
16-
uses: 'clouddrove/[email protected]'
19+
- name: Terraform Format
20+
uses: clouddrove/[email protected]
1721
with:
18-
actions_subcommand: 'fmt'
19-
- name: 'Terraform Format'
20-
uses: 'clouddrove/[email protected]'
22+
actions_subcommand: fmt
23+
- name: Terraform Format
24+
uses: clouddrove/[email protected]
2125
with:
22-
actions_subcommand: 'fmt'
23-
26+
actions_subcommand: fmt
2427
basic:
25-
name: 'basic'
28+
name: basic
2629
runs-on: ubuntu-latest
2730
steps:
28-
- name: 'Checkout'
31+
- name: Create GitHub App token
32+
id: github-app-token
33+
uses: actions/create-github-app-token@v2
34+
with:
35+
app-id: ${{ secrets.InsiderActionsApplication_APP_ID }}
36+
private-key: ${{ secrets.InsiderActionsApplication_PRIVATE_KEY }}
37+
- name: Checkout
2938
uses: actions/[email protected]
30-
31-
- name: 'Configure AWS Credentials'
39+
- name: Configure AWS Credentials
3240
uses: clouddrove/configure-aws-credentials@v1
3341
with:
3442
aws-access-key-id: ${{ secrets.TEST_AWS_ACCESS_KEY }}
3543
aws-secret-access-key: ${{ secrets.TEST_AWS_ACCESS_SECRET_KEY }}
3644
aws-region: us-east-2
37-
38-
- name: 'Terraform init for basic'
39-
uses: 'clouddrove/[email protected]'
45+
- name: Terraform init for basic
46+
uses: clouddrove/[email protected]
4047
with:
41-
actions_subcommand: 'init'
48+
actions_subcommand: init
4249
tf_actions_working_dir: ./_example/basic
43-
44-
- name: 'Terraform validate for basic'
45-
uses: 'clouddrove/[email protected]'
50+
- name: Terraform validate for basic
51+
uses: clouddrove/[email protected]
4652
with:
47-
actions_subcommand: 'validate'
53+
actions_subcommand: validate
4854
tf_actions_working_dir: ./_example/basic
49-
50-
- name: 'Terraform plan for basic'
51-
uses: 'clouddrove/[email protected]'
55+
- name: Terraform plan for basic
56+
uses: clouddrove/[email protected]
5257
with:
53-
actions_subcommand: 'plan'
58+
actions_subcommand: plan
5459
tf_actions_working_dir: ./_example/basic
55-
5660
complete:
57-
name: 'complete'
61+
name: complete
5862
runs-on: ubuntu-latest
5963
steps:
60-
- name: 'Checkout'
64+
- name: Create GitHub App token
65+
id: github-app-token
66+
uses: actions/create-github-app-token@v2
67+
with:
68+
app-id: ${{ secrets.InsiderActionsApplication_APP_ID }}
69+
private-key: ${{ secrets.InsiderActionsApplication_PRIVATE_KEY }}
70+
- name: Checkout
6171
uses: actions/[email protected]
62-
63-
- name: 'Configure AWS Credentials'
72+
- name: Configure AWS Credentials
6473
uses: clouddrove/configure-aws-credentials@v1
6574
with:
6675
aws-access-key-id: ${{ secrets.TEST_AWS_ACCESS_KEY }}
6776
aws-secret-access-key: ${{ secrets.TEST_AWS_ACCESS_SECRET_KEY }}
6877
aws-region: us-east-2
69-
70-
- name: 'Terraform init for complete'
71-
uses: 'clouddrove/[email protected]'
78+
- name: Terraform init for complete
79+
uses: clouddrove/[email protected]
7280
with:
73-
actions_subcommand: 'init'
81+
actions_subcommand: init
7482
tf_actions_working_dir: ./_example/complete
75-
76-
- name: 'Terraform validate complete'
77-
uses: 'clouddrove/[email protected]'
83+
- name: Terraform validate complete
84+
uses: clouddrove/[email protected]
7885
with:
79-
actions_subcommand: 'validate'
86+
actions_subcommand: validate
8087
tf_actions_working_dir: ./_example/complete
81-
82-
8388
pre-commit:
84-
name: 'Pre-Commit'
89+
name: Pre-Commit
8590
needs:
8691
- fmt
8792
- basic
8893
- complete
8994
runs-on: ubuntu-latest
9095
steps:
91-
- name: 'Checkout'
96+
- name: Create GitHub App token
97+
id: github-app-token
98+
uses: actions/create-github-app-token@v2
99+
with:
100+
app-id: ${{ secrets.InsiderActionsApplication_APP_ID }}
101+
private-key: ${{ secrets.InsiderActionsApplication_PRIVATE_KEY }}
102+
- name: Checkout
92103
uses: actions/[email protected]
93-
94-
- name: 'Install Tflint'
104+
- name: Install Tflint
95105
run: |
96106
curl https://raw.githubusercontent.com/terraform-linters/tflint/master/install_linux.sh | bash
97-
98-
- name: 'Pre-Commit 🔎'
107+
- name: Pre-Commit 🔎
99108
uses: pre-commit/[email protected]
100109
continue-on-error: true
101-
102-
- name: 'Slack Notification'
110+
- name: Slack Notification
103111
uses: clouddrove/action-slack@v2
104112
with:
105113
status: ${{ job.status }}
106114
fields: repo,author
107-
author_name: 'CloudDrove'
115+
author_name: CloudDrove
108116
env:
109-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # required
110-
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_TERRAFORM }} # required
117+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
118+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_TERRAFORM }}
111119
if: always()

0 commit comments

Comments
 (0)