Skip to content
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: Update GitHub Actions workflows #779

Merged
merged 7 commits into from
Jul 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ concurrency:
group: one-at-time
cancel-in-progress: false

permissions:
contents: read

jobs:
checks:
name: Checks
Expand All @@ -31,7 +34,7 @@ jobs:
run: make check-vuln

- name: Check for linting errors
uses: golangci/golangci-lint-action@v3
uses: golangci/golangci-lint-action@639cd343e1d3b897ff35927a75193d57cfcba299 # pin@3.6.0
with:
version: latest
args: -v -c .golangci.yml
Expand Down Expand Up @@ -62,6 +65,7 @@ jobs:
name: Integration Tests
runs-on: ubuntu-latest
needs: unit-tests

# Skip running if the PR is coming from a fork or is created by dependabot or snyk due to missing repo secrets.
if: github.event.pull_request.head.repo.fork == false && (github.actor != 'dependabot[bot]' && github.actor != 'snyk-bot')

Expand Down Expand Up @@ -93,7 +97,7 @@ jobs:
path: ./unit-tests-artifact

- name: Update codecov report
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # pin@3.1.4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./unit-tests-artifact/coverage-unit-tests.out,./coverage-integration-tests.out
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/pull-request-target.trigger-deferred.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: "(PR) Trigger Deferred"

on:
pull_request_target: {}

permissions: {}

jobs:
pr-trigger-deferred:
name: Trigger
runs-on: ubuntu-latest

steps:
- run: exit 0
7 changes: 5 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ name: goreleaser
on:
push:
tags:
- 'v*'
- "v*"

permissions:
contents: write

jobs:
goreleaser:
Expand All @@ -22,7 +25,7 @@ jobs:
check-latest: true

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v3
uses: goreleaser/goreleaser-action@336e29918d653399e599bfca99fadc1d7ffbc9f7 # pin@4.3.0
with:
version: latest
args: release --rm-dist
Expand Down
17 changes: 11 additions & 6 deletions .github/workflows/semgrep.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
name: Semgrep
name: "Semgrep"

on:
pull_request_target: {}
workflow_run:
workflows:
- "(PR) Trigger Deferred"
push:
branches: ["main"]
branches:
- main
schedule:
- cron: '30 0 1,15 * *' # Scheduled for 00:30 UTC on both the 1st and 15th of the month.
- cron: "30 0 1,15 * *"

permissions: {}

jobs:
semgrep:
name: Scan
runs-on: ubuntu-latest

container:
image: returntocorp/semgrep

# Skip any PR created by dependabot or snyk to avoid permission issues.
if: (github.actor != 'dependabot[bot]' && github.actor != 'snyk-bot')
steps:
- uses: actions/checkout@v3

- run: semgrep ci
env:
SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN }}