Skip to content

Commit 903fa0a

Browse files
Florian KnopFlorian Knop
Florian Knop
authored and
Florian Knop
committed
Merge remote-tracking branch 'upstream/main'
2 parents 5a87fc2 + 45fd1cb commit 903fa0a

File tree

204 files changed

+21652
-6308
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

204 files changed

+21652
-6308
lines changed

.ci/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#syntax=docker/dockerfile:1.2
2-
FROM node:18 as build
2+
FROM node:20 as build
33
WORKDIR /lambdas
44
RUN apt-get update \
55
&& apt-get install -y zip \

.ci/terraform-init-all.sh

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/usr/bin/env bash
2+
3+
# This script will run terraform init in all subdirectories of the examples directory
4+
# required to run tflint via pre-commit
5+
6+
# only run the script if a uniique pid file exits if not creat it or --force flag is passed
7+
pid="/tmp/philips-labs-terraform-aws-github-runner.pid"
8+
if [ "$1" == "--force" ]; then
9+
rm -f /tmp/philips-labs-terraform-aws-github-runner.pid
10+
fi
11+
12+
if [ ! -f $pid ]; then
13+
echo $$ > $pid
14+
else
15+
echo "Init all terraform directories will be skipped. To run the script remove the file $pid or run with --force"
16+
exit 0
17+
fi
18+
19+
# Change to the examples directory
20+
example_dirs=$(find examples -mindepth 1 -maxdepth 2 -type d | grep -v "templates")
21+
module_dirs=$(find modules -mindepth 1 -maxdepth 2 -type d | grep -v "templates")
22+
23+
# merge example_dirs and module_dirs in terraform_dirs
24+
terraform_dirs=$(echo $example_dirs $module_dirs "modules/runners/pool" | tr " " "\n" | sort -u | tr "\n" " ")
25+
26+
for dir in $terraform_dirs; do
27+
# Check if the subdirectory exists in Git
28+
if git rev-parse --is-inside-work-tree &>/dev/null && git ls-files --error-unmatch "$dir" &>/dev/null; then
29+
echo "Running terraform init in ${dir} - supressing output"
30+
pushd "$dir" >/dev/null
31+
terraform init -lockfile=readonly -backend=false &>/dev/null || true
32+
popd >/dev/null
33+
fi
34+
done

.devcontainer/Dockerfile

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ARG VARIANT="20-bullseye"
2+
FROM mcr.microsoft.com/vscode/devcontainers/typescript-node:0-${VARIANT}

.devcontainer/bashrc.sh

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
open_workspace() {
2+
local workspace_file=$WORKSPACE/.vscode/gh-runners.code-workspace
3+
4+
if ! [ -f "$workspace_file" ]; then
5+
echo "🔴 Missing workspace file"
6+
return 1
7+
fi
8+
9+
echo "🟡 Opening workspace"
10+
if code "$workspace_file"; then
11+
echo "🟢 Workspace opened"
12+
return 0
13+
else
14+
echo "🔴 Failed to open workspace"
15+
return 1
16+
fi
17+
}

.devcontainer/devcontainer.json

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"name": "GitHub Runners AWS",
3+
"build": { "dockerfile": "Dockerfile" },
4+
"features": {
5+
"ghcr.io/devcontainers/features/github-cli:1": {},
6+
"ghcr.io/devcontainers/features/terraform:1": {}
7+
},
8+
9+
"containerEnv": {
10+
"WORKSPACE": "${containerWorkspaceFolder}" // e.g. /workspaces/my-project
11+
},
12+
13+
"customizations": {
14+
"vscode": {
15+
"extensions": [
16+
"dbaeumer.vscode-eslint",
17+
"editorconfig.editorconfig",
18+
"esbenp.prettier-vscode",
19+
"firsttris.vscode-jest-runner",
20+
"hashicorp.hcl",
21+
"hashicorp.terraform",
22+
"hashicorp.terraform",
23+
"orta.vscode-jest",
24+
"yzhang.markdown-all-in-one"
25+
]
26+
}
27+
},
28+
"postCreateCommand": {
29+
"bash_command": "bash ${containerWorkspaceFolder}/.devcontainer/postCreateScript.sh",
30+
"welcome": "sudo cp -v .devcontainer/welcome.txt /usr/local/etc/vscode-dev-containers/first-run-notice.txt || true && sudo cp -v .devcontainer/welcome.txt /workspaces/.codespaces/shared/first-run-notice.txt || true"
31+
}
32+
}

.devcontainer/postCreateScript.sh

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
printf "source \$WORKSPACE/.devcontainer/bashrc.sh\n" >> ~/.bashrc

.devcontainer/welcome.txt

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
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+
================================================================================
40+
==========================================================================-:-=++
41+
42+
43+
Welcome to the AWS GitHub runners:
44+
45+
Load the vscode workspace to get started
46+
47+
Option 1: run `open_workspace`
48+
Option 2: open the workspace file `.vscoe/gh-runners.code-workspace` and load the workspace
49+
50+
Build the lambda:
51+
- cd lambdas
52+
- yarn instal & yarn run dist
53+

.github/workflows/auto-approve-dependabot.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ jobs:
1212
if: github.actor == 'dependabot[bot]' || github.actor == 'dependabot-preview[bot]'
1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: hmarr/auto-approve-action@44888193675f29a83e04faf4002fa8c0b537b1e4 # ratchet:hmarr/auto-approve-action@v3.2.1
15+
- uses: hmarr/auto-approve-action@f0939ea97e9205ef24d872e76833fa908a770363 # ratchet:hmarr/auto-approve-action@v4.0.0
1616
with:
1717
github-token: "${{ secrets.GITHUB_TOKEN }}"

.github/workflows/lambda.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
strategy:
1313
matrix:
14-
node: [18]
14+
node: [20]
1515
container:
1616
image: node:${{ matrix.node }}
1717
defaults:
@@ -32,7 +32,7 @@ jobs:
3232
- name: Build distribution
3333
run: yarn build
3434
- name: Upload coverage report
35-
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v31.2
35+
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v31.2
3636
if: ${{ failure() }}
3737
with:
3838
name: coverage-reports

.github/workflows/release.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ jobs:
1414
contents: write
1515
actions: write
1616
steps:
17-
- uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
17+
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
1818
with:
19-
node-version: 18
19+
node-version: 20
2020
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # ratchet:actions/checkout@v4
2121
- name: Build dist
2222
working-directory: lambdas
23-
run: yarn install && yarn run test && yarn dist
23+
run: yarn install --frozen-lockfile && yarn run test && yarn dist
2424
- name: Get installation token
25-
uses: philips-software/app-token-action@a37926571e4cec6f219e06727136efdd073d8657 # ratchet:philips-software/app-token-action@v1.1.2
25+
uses: philips-software/app-token-action@9f5d57062c9f2beaffafaa9a34f66f824ead63a9 # ratchet:philips-software/app-token-action@v2.0.0
2626
id: token
2727
with:
2828
app_id: ${{ secrets.FOREST_RELEASER_APP_ID }}
@@ -34,13 +34,13 @@ jobs:
3434
run: echo "name=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT
3535
- name: Release
3636
id: release
37-
uses: google-github-actions/release-please-action@4c5670f886fe259db4d11222f7dff41c1382304d # ratchet:google-github-actions/release-please-action@v3
37+
uses: google-github-actions/release-please-action@cc61a07e2da466bebbc19b3a7dd01d6aecb20d1e # ratchet:google-github-actions/release-please-action@v3
3838
with:
3939
default-branch: ${{ steps.branch.outputs.name }}
4040
release-type: terraform-module
4141
token: ${{ steps.token.outputs.token }}
4242
- name: Upload Release Asset
43-
if: ${{ steps.release.outputs.releases_created }}
43+
if: ${{ steps.release.outputs.releases_created == 'true' }}
4444
env:
4545
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4646
run: |

.github/workflows/semantic-check.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # ratchet:actions/checkout@v4
17-
- uses: amannn/action-semantic-pull-request@47b15d52c5c30e94a17ec87eb8dd51ff5221fed9 # ratchet:amannn/action-semantic-pull-request@v5
17+
- uses: amannn/action-semantic-pull-request@e9fabac35e210fea40ca5b14c0da95a099eff26f # ratchet:amannn/action-semantic-pull-request@v5
1818
name: Check PR for Semantic Commit Message
1919
env:
2020
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/stale.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
stale:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/stale@1160a2240286f5da8ec72b1c0816ce2481aabf84 # ratchet:actions/stale@v7
13+
- uses: actions/stale@28ca1036281a5e5922ead5184a1bbf96e5fc984e # ratchet:actions/stale@v7
1414
with:
1515
stale-issue-message: >
1616
This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed if no further activity occurs. Thank you for your contributions.

.github/workflows/terraform.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
run: apk add --no-cache tar
4747
continue-on-error: true
4848
- if: contains(matrix.terraform, '1.5.')
49-
uses: actions/cache@v3.3.2
49+
uses: actions/cache@v4
5050
name: Cache TFLint plugin dir
5151
with:
5252
path: ~/.tflint.d/plugins
@@ -94,7 +94,7 @@ jobs:
9494
run: apk add --no-cache tar
9595
continue-on-error: true
9696
- if: contains(matrix.terraform, '1.3.')
97-
uses: actions/cache@v3.3.2
97+
uses: actions/cache@v4
9898
name: Cache TFLint plugin dir
9999
with:
100100
path: ~/.tflint.d/plugins
@@ -143,7 +143,7 @@ jobs:
143143
run: apk add --no-cache tar
144144
continue-on-error: true
145145
- if: contains(matrix.terraform, '1.5.')
146-
uses: actions/cache@v3.3.2
146+
uses: actions/cache@v4
147147
name: Cache TFLint plugin dir
148148
with:
149149
path: ~/.tflint.d/plugins

.github/workflows/update-docs.yml

+33-23
Original file line numberDiff line numberDiff line change
@@ -16,38 +16,48 @@ jobs:
1616
name: Auto update terraform docs
1717
runs-on: ubuntu-latest
1818
steps:
19-
- name: Get installation token
20-
uses: philips-software/app-token-action@a37926571e4cec6f219e06727136efdd073d8657 # ratchet:philips-software/[email protected]
21-
id: token
22-
with:
23-
app_id: ${{ secrets.FOREST_RELEASER_APP_ID }}
24-
app_base64_private_key: ${{ secrets.FOREST_RELEASER_APP_PRIVATE_KEY_BASE64 }}
25-
auth_type: installation
26-
27-
# We use the app for branches in this this repo to ensure PR chekcs are kept in place.
28-
- if: github.event_name == 'push' && github.repository_owner == 'philips-labs' && github.ref != 'refs/heads/main'
29-
name: Checkout with App Token
30-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # ratchet:actions/checkout@v4
31-
with:
32-
token: ${{ steps.token.outputs.token }}
33-
34-
- if: (github.event_name == 'push' && github.repository_owner != 'philips-labs') || github.ref == 'refs/heads/main'
35-
name: Checkout with GITHUB Action token
19+
- name: Checkout with GITHUB Action token
3620
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # ratchet:actions/checkout@v4
3721

3822
- name: Generate TF docs
3923
uses: terraform-docs/gh-actions@f6d59f89a280fa0a3febf55ef68f146784b20ba0 # ratchet:terraform-docs/[email protected]
4024
with:
4125
find-dir: .
4226
git-commit-message: "docs: auto update terraform docs"
43-
git-push: ${{ github.ref != 'refs/heads/main' }}
27+
git-push: ${{ github.ref != 'refs/heads/main' || github.repository_owner != 'philips-labs' }}
4428

29+
# change docs via PR in case of locked main branch
4530
- name: Create Pull Request (main branch only)
46-
if: github.ref == 'refs/heads/main'
47-
uses: peter-evans/create-pull-request@153407881ec5c347639a548ade7d8ad1d6740e38 # ratchet:peter-evans/create-pull-request@v5.0.2
31+
if: github.ref == 'refs/heads/main' && github.repository_owner == 'philips-labs'
32+
uses: peter-evans/create-pull-request@b1ddad2c994a25fbc81a28b3ec0e368bb2021c50 # ratchet:peter-evans/create-pull-request@v6.0.0
4833
with:
49-
token: ${{ steps.token.outputs.token || secrets.GITHUB_TOKEN }}
50-
commit-message: "Update Terraform docs"
34+
token: ${{ secrets.GITHUB_TOKEN }}
35+
commit-message: "docs: auto update terraform docs"
5136
title: "docs: Update Terraform docs"
52-
branch: ${{ github.event.pull_request.base.ref }}-update-docs
37+
branch: update-docs
38+
branch-suffix: random
5339
base: ${{ github.event.pull_request.base.ref }}
40+
delete-branch: true
41+
42+
deploy-pages:
43+
needs: [docs]
44+
runs-on: ubuntu-latest
45+
steps:
46+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # ratchet:actions/checkout@v4
47+
- name: Configure Git Credentials
48+
run: |
49+
git config user.name github-actions[bot]
50+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
51+
- uses: actions/setup-python@v5
52+
with:
53+
python-version: 3.x
54+
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
55+
- uses: actions/cache@v4
56+
with:
57+
key: mkdocs-material-${{ env.cache_id }}
58+
path: .cache
59+
restore-keys: |
60+
mkdocs-material-
61+
- run: pip install mkdocs-material
62+
- run: pip install mkdocs-material-extensions
63+
- run: mkdocs gh-deploy --force -c -b gh-pages

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@ secrets.auto.tfvars
2222
**/coverage/*
2323

2424
node_modules/
25+
site/

.terraform.lock.hcl

+45
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)