-
Notifications
You must be signed in to change notification settings - Fork 17
ci: improvements #1254
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ci: improvements #1254
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| name: Build | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| pull_request: | ||
|
|
||
| jobs: | ||
| build: | ||
| if: ${{ github.actor != 'dependabot[bot]' }} | ||
| name: Build | ||
| uses: ./.github/workflows/reusable-build.yaml | ||
| with: | ||
| ref: ${{ github.head_ref }} |
This file was deleted.
| Original file line number | Diff line number | Diff line change | |||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,105 @@ | |||||||||||||||||||||||||||||
| name: Build | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| on: | |||||||||||||||||||||||||||||
| workflow_call: | |||||||||||||||||||||||||||||
| inputs: | |||||||||||||||||||||||||||||
| ref: | |||||||||||||||||||||||||||||
| required: true | |||||||||||||||||||||||||||||
| type: string | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| jobs: | |||||||||||||||||||||||||||||
| build: | |||||||||||||||||||||||||||||
| name: Build | |||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | |||||||||||||||||||||||||||||
| steps: | |||||||||||||||||||||||||||||
| - name: Checkout | |||||||||||||||||||||||||||||
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 | |||||||||||||||||||||||||||||
| with: | |||||||||||||||||||||||||||||
| ref: ${{ inputs.ref }} | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| - name: Setup Go | |||||||||||||||||||||||||||||
| uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 | |||||||||||||||||||||||||||||
| with: | |||||||||||||||||||||||||||||
| go-version: 1.24.x | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| - name: Build | |||||||||||||||||||||||||||||
| run: make build | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| lint: | |||||||||||||||||||||||||||||
| name: Lint | |||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | |||||||||||||||||||||||||||||
| steps: | |||||||||||||||||||||||||||||
| - name: Checkout | |||||||||||||||||||||||||||||
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 | |||||||||||||||||||||||||||||
| with: | |||||||||||||||||||||||||||||
| fetch-depth: 0 | |||||||||||||||||||||||||||||
| ref: ${{ inputs.ref }} | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| - name: Setup Go | |||||||||||||||||||||||||||||
| uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 | |||||||||||||||||||||||||||||
| with: | |||||||||||||||||||||||||||||
| go-version: 1.24.x | |||||||||||||||||||||||||||||
| cache: false | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| - run: make envoy | |||||||||||||||||||||||||||||
| - run: make pomerium-ui | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| - name: Run golangci-lint | |||||||||||||||||||||||||||||
| uses: golangci/golangci-lint-action@55c2c1448f86e01eaae002a5a3a9624417608d84 | |||||||||||||||||||||||||||||
| with: | |||||||||||||||||||||||||||||
| version: v1.64.8 | |||||||||||||||||||||||||||||
| args: --timeout=10m | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| pre-commit: | |||||||||||||||||||||||||||||
|
Comment on lines
+29
to
+53
Check warningCode scanning / CodeQL Workflow does not contain permissions Medium
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
Copilot AutofixAI 23 days ago To fix the issue, add a No method changes or additional imports are required—just the addition of a new YAML key.
Suggested changeset
1
.github/workflows/reusable-build.yaml
Copilot is powered by AI and may make mistakes. Always verify output.
Positive FeedbackNegative Feedback
Refresh and try again.
|
|||||||||||||||||||||||||||||
| name: Pre-Commit | |||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | |||||||||||||||||||||||||||||
| steps: | |||||||||||||||||||||||||||||
| - name: Checkout | |||||||||||||||||||||||||||||
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 | |||||||||||||||||||||||||||||
| with: | |||||||||||||||||||||||||||||
| fetch-depth: 0 | |||||||||||||||||||||||||||||
| ref: ${{ inputs.ref }} | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| - name: Setup Go | |||||||||||||||||||||||||||||
| uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 | |||||||||||||||||||||||||||||
| with: | |||||||||||||||||||||||||||||
| go-version: 1.24.x | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| - name: Setup Python | |||||||||||||||||||||||||||||
| uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c | |||||||||||||||||||||||||||||
| with: | |||||||||||||||||||||||||||||
| python-version: "3.x" | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| - name: Install Kustomize | |||||||||||||||||||||||||||||
| run: make kustomize | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| - name: Pre-Commit | |||||||||||||||||||||||||||||
| uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd | |||||||||||||||||||||||||||||
| with: | |||||||||||||||||||||||||||||
| extra_args: --show-diff-on-failure --from-ref ${{ | |||||||||||||||||||||||||||||
| github.event.pull_request.base.sha }} --to-ref ${{ | |||||||||||||||||||||||||||||
| github.event.pull_request.head.sha }} | |||||||||||||||||||||||||||||
| env: | |||||||||||||||||||||||||||||
| SKIP: go-mod-tidy,lint | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| test: | |||||||||||||||||||||||||||||
|
Comment on lines
+54
to
+85
Check warningCode scanning / CodeQL Workflow does not contain permissions Medium
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
Copilot AutofixAI 23 days ago The best way to fix the problem is to explicitly add a
Suggested changeset
1
.github/workflows/reusable-build.yaml
Copilot is powered by AI and may make mistakes. Always verify output.
Positive FeedbackNegative Feedback
Refresh and try again.
|
|||||||||||||||||||||||||||||
| name: Test | |||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | |||||||||||||||||||||||||||||
| steps: | |||||||||||||||||||||||||||||
| - name: Checkout | |||||||||||||||||||||||||||||
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 | |||||||||||||||||||||||||||||
| with: | |||||||||||||||||||||||||||||
| fetch-depth: 0 | |||||||||||||||||||||||||||||
| ref: ${{ inputs.ref }} | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| - name: Setup Go | |||||||||||||||||||||||||||||
| uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 | |||||||||||||||||||||||||||||
| with: | |||||||||||||||||||||||||||||
| go-version: 1.24.x | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| - name: set env vars | |||||||||||||||||||||||||||||
| run: echo "$(go env GOPATH)/bin" >> $GITHUB_PATH | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| - name: Test | |||||||||||||||||||||||||||||
| if: runner.os == 'Linux' | |||||||||||||||||||||||||||||
| run: make test | |||||||||||||||||||||||||||||
|
Comment on lines
+86
to
+105
Check warningCode scanning / CodeQL Workflow does not contain permissions Medium
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
Copilot AutofixAI 23 days ago To fix the problem, add an explicit
Suggested changeset
1
.github/workflows/reusable-build.yaml
Copilot is powered by AI and may make mistakes. Always verify output.
Positive FeedbackNegative Feedback
Refresh and try again.
|
|||||||||||||||||||||||||||||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -82,7 +82,7 @@ test: envoy generated pomerium-ui | |
| .PHONY: lint | ||
| lint: envoy pomerium-ui | ||
| @echo "==> $@" | ||
| @VERSION=$$(go run github.com/mikefarah/yq/[email protected] '.jobs.lint.steps[] | select(.uses == "golangci/golangci-lint-action*") | .with.version' .github/workflows/lint.yml) && \ | ||
| @VERSION=$$(go run github.com/mikefarah/yq/[email protected] '.jobs.lint.steps[] | select(.uses == "golangci/golangci-lint-action*") | .with.version' .github/workflows/reusable-build.yaml) && \ | ||
| go run github.com/golangci/golangci-lint/cmd/golangci-lint@$$VERSION run --fix ./... | ||
|
|
||
| ##@ Build | ||
|
|
@@ -212,6 +212,9 @@ docs: generated | |
| @echo "==> $@" | ||
| @go run docs/cmd/main.go > reference.md | ||
|
|
||
| .PHONY: generate | ||
| generate: deployment docs | ||
|
|
||
| # | ||
| # --- internal development targets | ||
| # | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,38 +1,44 @@ | ||
| {{define "object-properties"}}{{if .}} | ||
| {{- define "object-properties"}} | ||
| {{- if .}} | ||
| <table> | ||
| <thead> | ||
| </thead> | ||
| <tbody> | ||
| {{range .}} | ||
| {{- range .}} | ||
| <tr> | ||
| <td> | ||
| <p> | ||
| <code>{{.ID}}</code>   | ||
| {{if .ObjectRef}} | ||
| {{- if .ObjectRef}} | ||
| <strong>object</strong>  | ||
| (<a href="#{{.ObjectRef | anchor}}">{{.ObjectRef}}</a>) | ||
| {{else if and .Atomic .Atomic.ExplainFormat}} | ||
| {{- else if and .Atomic .Atomic.ExplainFormat}} | ||
| <strong>{{.Atomic.Type}}</strong>  | ||
| ({{.Atomic.Format}}) | ||
| {{else if .Atomic}} | ||
| {{- else if .Atomic}} | ||
| <strong>{{.Atomic.Type}}</strong>  | ||
| {{else if .Map.Atomic}} | ||
| {{- else if .Map.Atomic}} | ||
| <strong>map[string]{{.Map.Atomic.Type}}</strong> | ||
| {{else if .Map.ObjectRef}} | ||
| {{- else if .Map.ObjectRef}} | ||
| <strong>map[string]</strong> | ||
| <a href="#{{.Map.ObjectRef | anchor}}">{{.Map.ObjectRef}}</a> | ||
| {{end}} | ||
| {{- end}} | ||
| </p> | ||
| <p> | ||
| {{if .Required}}<strong>Required.</strong> {{end}} | ||
| {{- if .Required}} | ||
| <strong>Required.</strong>  | ||
| {{- end}} | ||
| {{- if .Description}} | ||
| {{.Description}} | ||
| {{- end}} | ||
| </p> | ||
| {{if and .Atomic .Atomic.ExplainFormat}} | ||
| {{- if and .Atomic .Atomic.ExplainFormat}} | ||
| Format: {{.Atomic.ExplainFormat}} | ||
| {{end}} | ||
| {{- end}} | ||
| </td> | ||
| </tr> | ||
| {{end}} | ||
| {{- end}} | ||
| </tbody> | ||
| </table> | ||
| {{end}}{{end}} | ||
| {{- end}} | ||
| {{- end}} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| {{define "object"}} | ||
| {{.Description}} | ||
| {{template "object-properties" .Properties}} | ||
| {{end}} | ||
| {{- end}} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| {{define "objects"}} | ||
| {{- define "objects" }} | ||
| {{range .}} | ||
| ### `{{.ID}}` | ||
| {{template "object" .}} | ||
| {{end}} | ||
| {{end}} | ||
| {{- end}} |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Copilot Autofix
AI 23 days ago
To fix this problem, we should add a
permissionsblock to the workflow file. The safest and simplest way is to apply the permissions block at the workflow root, which sets the minimal permissions for all jobs unless overridden per job. Since none of the jobs require write access to repository contents or other resources, the recommended minimal permissions arecontents: read. This restricts GITHUB_TOKEN to only read repository contents, which suffices for actions likeactions/checkoutand is inline with least privilege. The change should be made right after thename:andon:blocks, before thejobs:block. No further changes, methods, or imports are needed beyond this YAML addition.