diff --git a/.github/auto-assignees.yml b/.github/auto-assignees.yml index 8f5a75a578..332725705f 100644 --- a/.github/auto-assignees.yml +++ b/.github/auto-assignees.yml @@ -9,17 +9,10 @@ reviewers: groups: maintainers: - - dsu-igeek - - sseago - - reasonerjt - - ywk253100 - - blackpiglet - - qiuming-best - - shubham-pampattiwar - - Lyndon-Li + - kaovilai tech-writer: - - a-mccarthy + - kaovilai files: 'site/**': diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000000..bc50d548fd --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,12 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + + +version: 2 +updates: + - package-ecosystem: "gomod" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "weekly" diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000000..ae1dd58663 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,74 @@ +# For most projects, this workflow file will not need changing; you simply need +# to commit it to your repository. +# +# You may wish to alter this file to override the set of languages analyzed, +# or to provide custom queries or build logic. +# +# ******** NOTE ******** +# We have attempted to detect the languages in your repository. Please check +# the `language` matrix defined below to confirm you have the correct set of +# supported CodeQL languages. +# +name: "CodeQL" + +on: + push: + branches: [ "main" ] + pull_request: + # The branches below must be a subset of the branches above + branches: [ "main" ] + schedule: + - cron: '28 10 * * 1' + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: [ 'go', 'javascript' ] + # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] + # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + + # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs + # queries: security-extended,security-and-quality + + + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v2 + + # ℹī¸ Command-line programs to run using the OS shell. + # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun + + # If the Autobuild fails above, remove it and uncomment the following three lines. + # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. + + # - run: | + # echo "Run, Build Application using script" + # ./location_of_script_within_repo/buildscript.sh + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 + with: + category: "/language:${{matrix.language}}" diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 060dda2bd7..16024d4066 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -13,6 +13,8 @@ jobs: build: name: Build runs-on: ubuntu-latest + permissions: + packages: write steps: - name: Set up Go @@ -58,13 +60,30 @@ jobs: # Use the JSON key in secret to login gcr.io - uses: 'docker/login-action@v1' + id: gcr-login with: registry: 'gcr.io' # or REGION.docker.pkg.dev username: '_json_key' password: '${{ secrets.GCR_SA_KEY }}' + continue-on-error: true # Push image to GCR to facilitate some environments that have rate limitation to docker hub, e.g. vSphere. - name: Publish container image to GCR - if: github.repository == 'vmware-tanzu/velero' + if: github.repository == 'vmware-tanzu/velero' && steps.gcr-login.outcome == 'success' run: | REGISTRY=gcr.io/velero-gcp ./hack/docker-push.sh + + - name: Login to GitHub registry if it's a fork + if: github.event_name != 'pull_request' && github.repository != 'vmware-tanzu/velero' + id: ghcr-login + uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Publish container image to GitHub registry if it's a fork + if: github.event_name != 'pull_request' && github.repository != 'vmware-tanzu/velero' && steps.ghcr-login.outcome == 'success' + run: | + REGISTRY=ghcr.io/${{ github.actor }} ./hack/docker-push.sh + diff --git a/.github/workflows/sync-fork.yml b/.github/workflows/sync-fork.yml new file mode 100644 index 0000000000..cf502ff612 --- /dev/null +++ b/.github/workflows/sync-fork.yml @@ -0,0 +1,33 @@ + +name: Sync Fork + +on: + schedule: + - cron: '*/30 * * * *' # every 30 minutes + workflow_dispatch: # on button click + +jobs: + sync: + runs-on: ubuntu-latest + strategy: + matrix: + include: + - base: main + head: vmware-tanzu:main + - base: release-1.9 + head: vmware-tanzu:release-1.9 + - base: konveyor-dev + head: openshift:konveyor-dev + - base: konveyor-1.9 + head: openshift:konveyor-1.9 + - base: oadp-1.1 + head: openshift:oadp-1.1 + - base: oadp-1.0 + head: openshift:oadp-1.0 + fail-fast: false + steps: + - uses: kaovilai/fork-sync@v0.0.03 + with: + token: ${{ secrets.GITHUB_TOKEN }} + base: ${{ matrix.base }} + head: ${{ matrix.head }} diff --git a/hack/build-image/Dockerfile b/hack/build-image/Dockerfile index b3c5e42a04..7463723b06 100644 --- a/hack/build-image/Dockerfile +++ b/hack/build-image/Dockerfile @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM golang:1.18 +FROM golang:1.20 ARG GOPROXY