Skip to content
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
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ updates:
directory: "/"
schedule:
interval: "weekly"
cooldown:
default-days: 7
labels:
- "ok-to-test"
- "dependencies"
Expand All @@ -22,6 +24,8 @@ updates:
directory: "/"
schedule:
interval: "weekly"
cooldown:
default-days: 7
labels:
- "ok-to-test"
- "dependencies"
Expand Down
45 changes: 35 additions & 10 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ defaults:

permissions:
contents: read
checks: write # Used to annotate code in the PR

jobs:
changes:
Expand All @@ -24,16 +23,23 @@ jobs:
steps:
- name: Get base depth
id: base-depth
run: echo "base-depth=$(expr ${{ github.event.pull_request.commits }} + 1)" >> $GITHUB_OUTPUT
env:
PR_COMMITS: ${{ github.event.pull_request.commits }}
run: echo "base-depth=$(expr "${PR_COMMITS}" + 1)" >> $GITHUB_OUTPUT
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: ${{ steps.base-depth.outputs.base-depth }}
persist-credentials: false
- name: detect
id: detect
env:
GITHUB_BASE_REF_NAME: ${{ github.base_ref }}
BASE_SHA: ${{ github.event.pull_request.base.sha }}
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
run: |
git fetch origin ${{ github.base_ref }}
CHANGED_FILES=$(git diff --name-only ${{ github.event.pull_request.base.sha }}...${{ github.event.pull_request.head.sha }} | tr ' ' '\n')
git fetch origin "${GITHUB_BASE_REF_NAME}"
CHANGED_FILES=$(git diff --name-only "${BASE_SHA}...${HEAD_SHA}" | tr ' ' '\n')

echo -e "Changed files:\n${CHANGED_FILES}"

Expand Down Expand Up @@ -66,6 +72,8 @@ jobs:
if: ${{ needs.changes.outputs.non-docs == 'true' }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version-file: "go.mod"
Expand All @@ -76,10 +84,14 @@ jobs:
name: lint
runs-on: ubuntu-latest
needs: [changes]
permissions:
contents: read
checks: write # Used by golangci-lint-action to annotate code in the PR
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
persist-credentials: false
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version-file: "go.mod"
Expand Down Expand Up @@ -113,6 +125,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version-file: "go.mod"
Expand All @@ -125,6 +139,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version-file: "go.mod"
Expand All @@ -139,6 +155,8 @@ jobs:
KOCACHE: /tmp/ko-cache
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version-file: "go.mod"
Expand All @@ -165,14 +183,21 @@ jobs:
if: always()
steps:
- name: Check CI results
env:
BUILD: ${{ needs.build.result }}
LINTING: ${{ needs.linting.result }}
TESTS: ${{ needs.tests.result }}
GENERATED: ${{ needs.generated.result }}
MULTI_ARCH_BUILD: ${{ needs.multi-arch-build.result }}
E2E_TESTS: ${{ needs.e2e-tests.result }}
run: |
results=(
"build=${{ needs.build.result }}"
"linting=${{ needs.linting.result }}"
"tests=${{ needs.tests.result }}"
"generated=${{ needs.generated.result }}"
"multi-arch-build=${{ needs.multi-arch-build.result }}"
"e2e-tests=${{ needs.e2e-tests.result }}"
"build=${BUILD}"
"linting=${LINTING}"
"tests=${TESTS}"
"generated=${GENERATED}"
"multi-arch-build=${MULTI_ARCH_BUILD}"
"e2e-tests=${E2E_TESTS}"
)
failed=0
for r in "${results[@]}"; do
Expand Down
12 changes: 10 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,20 @@ on:
schedule:
- cron: '30 20 * * 2'

permissions: {}

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
actions: read # Required by CodeQL to read workflow information
contents: read
security-events: write
security-events: write # Required to upload CodeQL SARIF results

strategy:
fail-fast: false
Expand All @@ -39,6 +45,8 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/e2e-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ jobs:

steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version-file: "go.mod"
Expand Down Expand Up @@ -55,7 +57,7 @@ jobs:
run: |
./test/setup-kind.sh \
--registry-url $(echo ${KO_DOCKER_REPO} | cut -d'/' -f 1) \
--cluster-suffix c${{ github.run_id }}.local \
--cluster-suffix "${CLUSTER_DOMAIN}" \
--nodes 3 \
--k8s-version v1.29.x \
--e2e-script ./test/gh-e2e-tests.sh \
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/go-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
name: Go coverage
runs-on: ubuntu-24.04
permissions:
pull-requests: write
pull-requests: write # Required by go-coverage-report to comment on PRs

steps:
- name: Harden runner
Expand All @@ -38,6 +38,7 @@ jobs:
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
path: ${{ github.workspace }}/src/github.com/tektoncd/triggers
persist-credentials: false

- name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/microshift.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ name: Integration Tests on microshift

permissions:
contents: read
packages: write

on:
push:
Expand Down Expand Up @@ -42,10 +41,12 @@ jobs:
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
path: ${{ github.workspace }}/src/github.com/tektoncd/triggers
persist-credentials: false

- name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
cache: false
cache-dependency-path: "${{ github.workspace }}/src/github.com/tektoncd/triggers/go.sum"
go-version-file: "${{ github.workspace }}/src/github.com/tektoncd/triggers/go.mod"

Expand Down Expand Up @@ -88,7 +89,7 @@ jobs:
curl https://infra.tekton.dev/tekton-releases/pipeline/latest/release.yaml | yq 'del(.spec.template.spec.containers[]?.securityContext.runAsUser, .spec.template.spec.containers[]?.securityContext.runAsGroup)' > release
export RELEASE_YAML=$(realpath release)

${{ github.workspace }}/src/github.com/tektoncd/triggers/test/gh-e2e-tests.sh
"${GOPATH}/src/github.com/tektoncd/triggers/test/gh-e2e-tests.sh"

- name: Upload test results
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/zizmor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: GitHub Actions Security Analysis with zizmor

on:
push:
branches: ["main"]
pull_request:
branches: ["**"]

permissions: {}

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
zizmor:
name: zizmor
runs-on: ubuntu-latest
permissions:
security-events: write # Required to upload SARIF results
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false

- name: Run zizmor
uses: zizmorcore/zizmor-action@71321a20a9ded102f6e9ce5718a2fcec2c4f70d8 # v0.5.2
Loading