Skip to content

Commit 2dd8007

Browse files
committed
Fix GHA Permissions
Why these changes are being introduced: The workflows do not need to permission to make any changes to the code itself, so we restrict to just `read-only`. How this addresses that need: * Add a line to each of the GHA workflows to restrict the workflow to just read-only permissions to the code in the repository. Additionally, * Add a `temp/` directory to the .gitignore file so that it's possible to do some local work moving files around without worrying about content getting accidentally pushed to GitHub * Minor formatting changes to a few files Side effects of this change: None.
1 parent 54b8f7f commit 2dd8007

File tree

5 files changed

+24
-13
lines changed

5 files changed

+24
-13
lines changed

.github/workflows/dev-build.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
### This is the Terraform-generated dev-build.yml workflow for the docker-matomo-dev app repository ###
2-
### If this is a Lambda repo, uncomment the FUNCTION line at the end of the document ###
3-
### If the container requires any additional pre-build commands, uncomment and edit ###
4-
### the PREBUILD line at the end of the document. ###
1+
### This is the Terraform-generated dev-build.yml workflow for the ###
2+
### docker-matomo-dev app repository. ###
3+
### If this is a Lambda repo, uncomment the FUNCTION line at the end of the ###
4+
### document. If the container requires any additional pre-build commands, ###
5+
### uncomment and edit the PREBUILD line at the end of the document. ###
56
name: Dev Container Build and Deploy
67
on:
78
workflow_dispatch:
@@ -11,6 +12,8 @@ on:
1112
paths-ignore:
1213
- '.github/**'
1314

15+
permissions: read-all
16+
1417
jobs:
1518
deploy:
1619
name: Dev Container Deploy

.github/workflows/prod-promote.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1-
### This is the Terraform-generated prod-promote.yml workflow for the docker-matomo-prod repository. ###
2-
### If this is a Lambda repo, uncomment the FUNCTION line at the end of the document. ###
1+
### This is the Terraform-generated prod-promote.yml workflow for the ###
2+
### docker-matomo-prod repository. ###
3+
### If this is a Lambda repo, uncomment the FUNCTION line at the end of the ###
4+
### document. ###
35
name: Prod Container Promote
46
on:
57
workflow_dispatch:
68
release:
79
types: [published]
810

11+
permissions: read-all
12+
913
jobs:
1014
deploy:
1115
name: Prod Container Promote

.github/workflows/stage-build.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
### This is the Terraform-generated dev-build.yml workflow for the docker-matomo-stage app repository ###
2-
### If this is a Lambda repo, uncomment the FUNCTION line at the end of the document ###
3-
### If the container requires any additional pre-build commands, uncomment and edit ###
4-
### the PREBUILD line at the end of the document. ###
1+
### This is the Terraform-generated dev-build.yml workflow for the ###
2+
### docker-matomo-stage app repository. ###
3+
### If this is a Lambda repo, uncomment the FUNCTION line at the end of the ###
4+
### document. If the container requires any additional pre-build commands, ###
5+
### uncomment and edit the PREBUILD line at the end of the document. ###
56
name: Stage Container Build and Deploy
67
on:
78
workflow_dispatch:
@@ -11,6 +12,8 @@ on:
1112
paths-ignore:
1213
- '.github/**'
1314

15+
permissions: read-all
16+
1417
jobs:
1518
deploy:
1619
name: Stage Container Deploy

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
.env
22
**/.DS_Store
3+
temp/

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
.PHONY: help dist-dev publish-dev dist-stage publish-stage
22
SHELL=/bin/bash
33
### This is the Terraform-generated header for docker-matomo-dev. If ###
4-
### this is a Lambda repo, uncomment the FUNCTION line below ###
5-
### and review the other commented lines in the document. ###
4+
### this is a Lambda repo, uncomment the FUNCTION line below ###
5+
### and review the other commented lines in the document. ###
66
ECR_NAME_DEV:=docker-matomo-dev
77
ECR_URL_DEV:=222053980223.dkr.ecr.us-east-1.amazonaws.com/docker-matomo-dev
88
# FUNCTION_DEV:=
9-
### End of Terraform-generated header ###
9+
### End of Terraform-generated header ###
1010

1111
help: ## Print this message
1212
@awk 'BEGIN { FS = ":.*##"; print "Usage: make <target>\n\nTargets:" } \

0 commit comments

Comments
 (0)