Skip to content

Commit

Permalink
Merge pull request #4 from remerge/update-template
Browse files Browse the repository at this point in the history
Update template
  • Loading branch information
hollow authored Nov 29, 2023
2 parents 48d1d8f + 768a3bf commit ee5e8e4
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 22 deletions.
3 changes: 1 addition & 2 deletions .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
---
# Changes here will be overwritten by Copier
_commit: v2.4.4
_commit: v2.5.1
_src_path: gh:remerge/template
is_golang_library: true
project_id: gobi
project_license: private
project_name: Gob Indirect
project_owner: core
project_type: default
run_workflows_for_all_branches: false
use_ansible: false
use_consul: false
use_golang: true
Expand Down
23 changes: 12 additions & 11 deletions .github/workflows/go-lib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,19 @@ on:
branches: [main, master, production]

permissions:
actions: read
checks: read
actions: none
checks: none
contents: read
deployments: read
issues: read
discussions: read
packages: read
pages: read
pull-requests: read
repository-projects: read
security-events: read
statuses: read
deployments: none
discussions: none
id-token: none
issues: none
packages: none
pages: none
pull-requests: none
repository-projects: none
security-events: none
statuses: none

jobs:
go-checks:
Expand Down
15 changes: 14 additions & 1 deletion .github/workflows/go-optional.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,20 @@ on:
schedule:
- cron: "30 0 * * 0"

permissions: read-all
permissions:
actions: none
checks: none
contents: read
deployments: none
discussions: none
id-token: none
issues: none
packages: none
pages: none
pull-requests: none
repository-projects: none
security-events: none
statuses: none

jobs:
go-modules:
Expand Down
20 changes: 16 additions & 4 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,32 @@ on:
push:
branches: [main, master]

permissions: read-all
permissions:
actions: none
checks: none
contents: read
deployments: none
discussions: none
id-token: none
issues: none
packages: none
pages: none
pull-requests: none
repository-projects: none
security-events: none
statuses: none

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- run: echo "GO_VERSION=$(grep '^go ' < go.mod | awk '{print $2}')" >> "$GITHUB_ENV"

- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
go-version: "stable"

- uses: webfactory/[email protected]
with:
ssh-private-key: "${{ secrets.DEPLOY_USER_SSH_KEY }}"
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -573,3 +573,6 @@ id_*
# only.
!*.tfvars
!*.tfvars.json

# Ignore direnv files
.direnv/
Expand Down
9 changes: 5 additions & 4 deletions go.mk
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
GO_VERSION := 1.21

SHADOW_LINTER := golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow
SHADOW_LINTER_VERSION := v0.13.0

Expand All @@ -10,8 +12,8 @@ REVIVE_LINTER := github.com/mgechev/revive

.PHONY: go-update
go-update:: ## update Go modules
go get -u -x
go mod tidy
@go get -u -x ./... 2>&1 | grep -vP '^(#|mkdir|cd|\d\.\d\d\ds #)' || :
@go mod tidy -v -x -go $(GO_VERSION)
update:: go-update

.PHONY: go-build
Expand Down Expand Up @@ -255,8 +257,7 @@ endif

divert: .check-dependencies .nomad-env .input-validation
@mkdir -p .build
@docker build --build-arg \
"GO_VERSION=$$(grep '^go ' < go.mod | awk '{print $$2}')" \
@docker build \
--build-arg "CI_COMMIT=$(TASK_IMAGE)" \
--build-arg "CI_REPO=$(PROJECT_REPO)" \
--build-arg "CI_REPO=$(DEV_WHOAMI)" \
Expand Down

0 comments on commit ee5e8e4

Please sign in to comment.