Skip to content

Commit

Permalink
Merge branch 'coder:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
projectoperations authored Oct 30, 2024
2 parents b161b95 + e9fbfcc commit 98a3fc5
Show file tree
Hide file tree
Showing 243 changed files with 6,913 additions and 4,852 deletions.
2 changes: 1 addition & 1 deletion .github/actions/setup-go/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: |
inputs:
version:
description: "The Go version to use."
default: "1.22.6"
default: "1.22.8"
runs:
using: "composite"
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/setup-tf/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ runs:
- name: Install Terraform
uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd # v3.1.2
with:
terraform_version: 1.9.2
terraform_version: 1.9.8
terraform_wrapper: false
5 changes: 2 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ jobs:
# Check for any typos
- name: Check for typos
uses: crate-ci/typos@6802cc60d4e7f78b9d5454f6cf3935c042d5e1e3 # v1.26.0
uses: crate-ci/typos@0d9e0c2c1bd7f770f6eb90f87780848ca02fc12c # v1.26.8
with:
config: .github/workflows/typos.toml

Expand Down Expand Up @@ -233,8 +233,7 @@ jobs:
gen:
timeout-minutes: 8
runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8' || 'ubuntu-latest' }}
needs: changes
if: needs.changes.outputs.docs-only == 'false' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main'
if: always()
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/docker-base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,18 @@ on:

permissions:
contents: read
# Necessary to push docker images to ghcr.io.
packages: write
# Necessary for depot.dev authentication.
id-token: write

# Avoid running multiple jobs for the same commit.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-docker-base

jobs:
build:
permissions:
# Necessary for depot.dev authentication.
id-token: write
# Necessary to push docker images to ghcr.io.
packages: write
runs-on: ubuntu-latest
if: github.repository_owner == 'coder'
steps:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/nightly-gauntlet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
# Every day at midnight
- cron: "0 0 * * *"
workflow_dispatch:

permissions:
contents: read

jobs:
go-race:
# While GitHub's toaster runners are likelier to flake, we want consistency
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/pr-cleanup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ on:
description: "PR number"
required: true

permissions:
packages: write

jobs:
cleanup:
runs-on: "ubuntu-latest"
permissions:
# Necessary to delete docker images from ghcr.io.
packages: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/pr-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ env:

permissions:
contents: read
packages: write
pull-requests: write # needed for commenting on PRs

jobs:
check_pr:
Expand Down Expand Up @@ -171,6 +169,8 @@ jobs:
needs: get_info
if: needs.get_info.outputs.BUILD == 'true' || github.event.inputs.deploy == 'true'
runs-on: "ubuntu-latest"
permissions:
pull-requests: write # needed for commenting on PRs
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
Expand Down Expand Up @@ -205,6 +205,9 @@ jobs:
# Run build job only if there are changes in the files that we care about or if the workflow is manually triggered with --build flag
if: needs.get_info.outputs.BUILD == 'true'
runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8' || 'ubuntu-latest' }}
permissions:
# Necessary to push docker images to ghcr.io.
packages: write
# This concurrency only cancels build jobs if a new build is triggred. It will avoid cancelling the current deployemtn in case of docs chnages.
concurrency:
group: build-${{ github.workflow }}-${{ github.ref }}-${{ needs.get_info.outputs.BUILD }}
Expand Down Expand Up @@ -425,7 +428,7 @@ jobs:
--first-user-username coder \
--first-user-email pr${{ env.PR_NUMBER }}@coder.com \
--first-user-password $password \
--first-user-trial \
--first-user-trial=false \
--use-token-as-session \
https://${{ env.PR_HOSTNAME }}
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/release-validation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
tags:
- "v*"

permissions:
contents: read

jobs:
network-performance:
runs-on: ubuntu-latest
Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,7 @@ on:
default: false

permissions:
# Required to publish a release
contents: write
# Necessary to push docker images to ghcr.io.
packages: write
# Necessary for GCP authentication (https://github.com/google-github-actions/setup-gcloud#usage)
id-token: write
contents: read

concurrency: ${{ github.workflow }}-${{ github.ref }}

Expand All @@ -40,6 +35,13 @@ jobs:
release:
name: Build and publish
runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8' || 'ubuntu-latest' }}
permissions:
# Required to publish a release
contents: write
# Necessary to push docker images to ghcr.io.
packages: write
# Necessary for GCP authentication (https://github.com/google-github-actions/setup-gcloud#usage)
id-token: write
env:
# Necessary for Docker manifest
DOCKER_CLI_EXPERIMENTAL: "enabled"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ jobs:

# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@f779452ac5af1c261dce0346a8f964149f49322b # v3.26.13
uses: github/codeql-action/upload-sarif@662472033e021d55d94146f66f6058822b0b39fd # v3.27.0
with:
sarif_file: results.sarif
20 changes: 15 additions & 5 deletions .github/workflows/security.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ name: "security"
permissions:
actions: read
contents: read
security-events: write

on:
workflow_dispatch:
Expand All @@ -23,6 +22,8 @@ concurrency:

jobs:
codeql:
permissions:
security-events: write
runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8' || 'ubuntu-latest' }}
steps:
- name: Harden Runner
Expand All @@ -37,7 +38,7 @@ jobs:
uses: ./.github/actions/setup-go

- name: Initialize CodeQL
uses: github/codeql-action/init@f779452ac5af1c261dce0346a8f964149f49322b # v3.26.13
uses: github/codeql-action/init@662472033e021d55d94146f66f6058822b0b39fd # v3.27.0
with:
languages: go, javascript

Expand All @@ -47,7 +48,7 @@ jobs:
rm Makefile
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@f779452ac5af1c261dce0346a8f964149f49322b # v3.26.13
uses: github/codeql-action/analyze@662472033e021d55d94146f66f6058822b0b39fd # v3.27.0

- name: Send Slack notification on failure
if: ${{ failure() }}
Expand All @@ -61,6 +62,8 @@ jobs:
"${{ secrets.SLACK_SECURITY_FAILURE_WEBHOOK_URL }}"
trivy:
permissions:
security-events: write
runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8' || 'ubuntu-latest' }}
steps:
- name: Harden Runner
Expand Down Expand Up @@ -95,13 +98,20 @@ jobs:
# protoc must be in lockstep with our dogfood Dockerfile or the
# version in the comments will differ. This is also defined in
# ci.yaml.
set -x
set -euxo pipefail
cd dogfood/contents
mkdir -p /usr/local/bin
mkdir -p /usr/local/include
DOCKER_BUILDKIT=1 docker build . --target proto -t protoc
protoc_path=/usr/local/bin/protoc
docker run --rm --entrypoint cat protoc /tmp/bin/protoc > $protoc_path
chmod +x $protoc_path
protoc --version
# Copy the generated files to the include directory.
docker run --rm -v /usr/local/include:/target protoc cp -r /tmp/include/google /target/
ls -la /usr/local/include/google/protobuf/
stat /usr/local/include/google/protobuf/timestamp.proto
- name: Build Coder linux amd64 Docker image
id: build
Expand Down Expand Up @@ -132,7 +142,7 @@ jobs:
severity: "CRITICAL,HIGH"

- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@f779452ac5af1c261dce0346a8f964149f49322b # v3.26.13
uses: github/codeql-action/upload-sarif@662472033e021d55d94146f66f6058822b0b39fd # v3.27.0
with:
sarif_file: trivy-results.sarif
category: "Trivy"
Expand Down
15 changes: 13 additions & 2 deletions .github/workflows/stale.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
name: Stale Issue, Banch and Old Workflows Cleanup
name: Stale Issue, Branch and Old Workflows Cleanup
on:
schedule:
# Every day at midnight
- cron: "0 0 * * *"
workflow_dispatch:

permissions:
contents: read

jobs:
issues:
runs-on: ubuntu-latest
permissions:
# Needed to close issues.
issues: write
# Needed to close PRs.
pull-requests: write
actions: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
Expand Down Expand Up @@ -86,6 +91,9 @@ jobs:
branches:
runs-on: ubuntu-latest
permissions:
# Needed to delete branches.
contents: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
Expand All @@ -105,6 +113,9 @@ jobs:
exclude_open_pr_branches: true
del_runs:
runs-on: ubuntu-latest
permissions:
# Needed to delete workflow runs.
actions: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
Expand Down
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@
"unauthenticate",
"unconvert",
"untar",
"userauth",
"userspace",
"VMID",
"walkthrough",
Expand Down
Loading

0 comments on commit 98a3fc5

Please sign in to comment.