mirror of
https://github.com/kubevela/kubevela.git
synced 2026-05-23 17:53:04 +00:00
Fix: limit github action permission (#5210)
* Fix: limit github action permission Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com> * all limit Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com> Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
This commit is contained in:
6
.github/workflows/back-port.yml
vendored
6
.github/workflows/back-port.yml
vendored
@@ -4,11 +4,17 @@ on:
|
||||
types:
|
||||
- closed
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
# align with crossplane's choice https://github.com/crossplane/crossplane/blob/master/.github/workflows/backport.yml
|
||||
open-pr:
|
||||
runs-on: ubuntu-20.04
|
||||
if: github.event.pull_request.merged
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
3
.github/workflows/chart.yml
vendored
3
.github/workflows/chart.yml
vendored
@@ -6,6 +6,9 @@ on:
|
||||
- "v*"
|
||||
workflow_dispatch: { }
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
env:
|
||||
BUCKET: ${{ secrets.OSS_BUCKET }}
|
||||
ENDPOINT: ${{ secrets.OSS_ENDPOINT }}
|
||||
|
||||
7
.github/workflows/codeql-analysis.yml
vendored
7
.github/workflows/codeql-analysis.yml
vendored
@@ -4,11 +4,18 @@ on:
|
||||
push:
|
||||
branches: [ master, release-* ]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
analyze:
|
||||
name: Analyze
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
permissions:
|
||||
actions: read # for github/codeql-action/init to get workflow details
|
||||
security-events: write # for github/codeql-action/autobuild to send a status report
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
|
||||
3
.github/workflows/commit-lint.yml
vendored
3
.github/workflows/commit-lint.yml
vendored
@@ -8,6 +8,9 @@ on:
|
||||
- labeled
|
||||
- unlabeled
|
||||
|
||||
permissions:
|
||||
pull-requests: read
|
||||
|
||||
jobs:
|
||||
check:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
65
.github/workflows/core-api-test.yml
vendored
65
.github/workflows/core-api-test.yml
vendored
@@ -1,38 +1,41 @@
|
||||
name: core-api-test
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- 'apis/**'
|
||||
- 'pkg/oam/**'
|
||||
- "hack/apis/**"
|
||||
branches:
|
||||
- master
|
||||
- release-*
|
||||
pull_request:
|
||||
paths:
|
||||
- 'apis/**'
|
||||
- 'pkg/oam/**'
|
||||
- "hack/apis/**"
|
||||
branches:
|
||||
- master
|
||||
- release-*
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
core-api-test:
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- name: Set up Go 1.19
|
||||
uses: actions/setup-go@v3
|
||||
env:
|
||||
GO_VERSION: '1.19'
|
||||
GOLANGCI_VERSION: 'v1.49'
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
id: go
|
||||
core-api-test:
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- name: Set up Go 1.19
|
||||
uses: actions/setup-go@v3
|
||||
env:
|
||||
GO_VERSION: '1.19'
|
||||
GOLANGCI_VERSION: 'v1.49'
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
id: go
|
||||
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v3
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Get the version
|
||||
id: get_version
|
||||
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
|
||||
- name: Get the version
|
||||
id: get_version
|
||||
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Test build kubevela-core-api
|
||||
env:
|
||||
VERSION: ${{ steps.get_version.outputs.VERSION }}
|
||||
COMMIT_ID: ${{ github.sha }}
|
||||
run: |
|
||||
bash ./hack/apis/clientgen.sh
|
||||
bash ./hack/apis/sync.sh test
|
||||
- name: Test build kubevela-core-api
|
||||
env:
|
||||
VERSION: ${{ steps.get_version.outputs.VERSION }}
|
||||
COMMIT_ID: ${{ github.sha }}
|
||||
run: |
|
||||
bash ./hack/apis/clientgen.sh
|
||||
bash ./hack/apis/sync.sh test
|
||||
3
.github/workflows/definition-lint.yml
vendored
3
.github/workflows/definition-lint.yml
vendored
@@ -11,6 +11,9 @@ on:
|
||||
- master
|
||||
- release-*
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
env:
|
||||
# Common versions
|
||||
GO_VERSION: '1.19'
|
||||
|
||||
5
.github/workflows/e2e-multicluster-test.yml
vendored
5
.github/workflows/e2e-multicluster-test.yml
vendored
@@ -13,6 +13,9 @@ on:
|
||||
- master
|
||||
- release-*
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
env:
|
||||
# Common versions
|
||||
GO_VERSION: '1.19'
|
||||
@@ -21,6 +24,8 @@ env:
|
||||
jobs:
|
||||
|
||||
detect-noop:
|
||||
permissions:
|
||||
actions: write
|
||||
runs-on: ubuntu-20.04
|
||||
outputs:
|
||||
noop: ${{ steps.noop.outputs.should_skip }}
|
||||
|
||||
5
.github/workflows/e2e-rollout-test.yml
vendored
5
.github/workflows/e2e-rollout-test.yml
vendored
@@ -13,6 +13,9 @@ on:
|
||||
- master
|
||||
- release-*
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
env:
|
||||
# Common versions
|
||||
GO_VERSION: '1.19'
|
||||
@@ -21,6 +24,8 @@ env:
|
||||
jobs:
|
||||
|
||||
detect-noop:
|
||||
permissions:
|
||||
actions: write
|
||||
runs-on: ubuntu-20.04
|
||||
outputs:
|
||||
noop: ${{ steps.noop.outputs.should_skip }}
|
||||
|
||||
5
.github/workflows/e2e-test.yml
vendored
5
.github/workflows/e2e-test.yml
vendored
@@ -13,6 +13,9 @@ on:
|
||||
- master
|
||||
- release-*
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
env:
|
||||
# Common versions
|
||||
GO_VERSION: '1.19'
|
||||
@@ -21,6 +24,8 @@ env:
|
||||
jobs:
|
||||
|
||||
detect-noop:
|
||||
permissions:
|
||||
actions: write
|
||||
runs-on: ubuntu-20.04
|
||||
outputs:
|
||||
noop: ${{ steps.noop.outputs.should_skip }}
|
||||
|
||||
8
.github/workflows/go.yml
vendored
8
.github/workflows/go.yml
vendored
@@ -11,6 +11,9 @@ on:
|
||||
- master
|
||||
- release-*
|
||||
|
||||
permissions: # added using https://github.com/step-security/secure-workflows
|
||||
contents: read
|
||||
|
||||
env:
|
||||
# Common versions
|
||||
GO_VERSION: '1.19'
|
||||
@@ -22,6 +25,8 @@ jobs:
|
||||
runs-on: ubuntu-20.04
|
||||
outputs:
|
||||
noop: ${{ steps.noop.outputs.should_skip }}
|
||||
permissions:
|
||||
actions: write
|
||||
steps:
|
||||
- name: Detect No-op Changes
|
||||
id: noop
|
||||
@@ -68,6 +73,9 @@ jobs:
|
||||
runs-on: ubuntu-20.04
|
||||
needs: detect-noop
|
||||
if: needs.detect-noop.outputs.noop != 'true'
|
||||
permissions:
|
||||
contents: read # for actions/checkout to fetch code
|
||||
pull-requests: read # for golangci/golangci-lint-action to fetch pull requests
|
||||
|
||||
steps:
|
||||
- name: Setup Go
|
||||
|
||||
6
.github/workflows/issue-commands.yml
vendored
6
.github/workflows/issue-commands.yml
vendored
@@ -5,6 +5,9 @@ on:
|
||||
issue_comment:
|
||||
types: [created]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
bot:
|
||||
runs-on: ubuntu-20.04
|
||||
@@ -32,6 +35,9 @@ jobs:
|
||||
backport:
|
||||
runs-on: ubuntu-22.04
|
||||
if: github.event.issue.pull_request && contains(github.event.comment.body, '/backport')
|
||||
permissions:
|
||||
issues: write
|
||||
pull-requests: write
|
||||
steps:
|
||||
- name: Extract Command
|
||||
id: command
|
||||
|
||||
3
.github/workflows/license.yml
vendored
3
.github/workflows/license.yml
vendored
@@ -9,6 +9,9 @@ on:
|
||||
branches:
|
||||
- master
|
||||
- release-*
|
||||
-
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
license_check:
|
||||
|
||||
3
.github/workflows/registry.yml
vendored
3
.github/workflows/registry.yml
vendored
@@ -11,6 +11,9 @@ env:
|
||||
ACCESS_KEY: ${{ secrets.OSS_ACCESS_KEY }}
|
||||
ACCESS_KEY_SECRET: ${{ secrets.OSS_ACCESS_KEY_SECRET }}
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
publish-core-images:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
3
.github/workflows/sync-api.yml
vendored
3
.github/workflows/sync-api.yml
vendored
@@ -7,6 +7,9 @@ on:
|
||||
tags:
|
||||
- "v*"
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
env:
|
||||
GO_VERSION: '1.19'
|
||||
|
||||
|
||||
3
.github/workflows/timed-task.yml
vendored
3
.github/workflows/timed-task.yml
vendored
@@ -2,6 +2,9 @@ name: Timed Task
|
||||
on:
|
||||
schedule:
|
||||
- cron: '* * * * *'
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
clean-image:
|
||||
runs-on: aliyun
|
||||
|
||||
3
.github/workflows/trivy-scan.yml
vendored
3
.github/workflows/trivy-scan.yml
vendored
@@ -4,6 +4,9 @@ on:
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
images:
|
||||
name: Image Scan
|
||||
|
||||
7
.github/workflows/unit-test.yml
vendored
7
.github/workflows/unit-test.yml
vendored
@@ -5,12 +5,15 @@ on:
|
||||
branches:
|
||||
- master
|
||||
- release-*
|
||||
workflow_dispatch: {}
|
||||
workflow_dispatch: { }
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
- release-*
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
env:
|
||||
# Common versions
|
||||
GO_VERSION: '1.19'
|
||||
@@ -19,6 +22,8 @@ env:
|
||||
jobs:
|
||||
|
||||
detect-noop:
|
||||
permissions:
|
||||
actions: write # for fkirc/skip-duplicate-actions to skip or stop workflow runs
|
||||
runs-on: ubuntu-20.04
|
||||
outputs:
|
||||
noop: ${{ steps.noop.outputs.should_skip }}
|
||||
|
||||
Reference in New Issue
Block a user