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

[release-21.0] Security improvements to GitHub Actions (#17520) #17531

Merged
merged 1 commit into from
Jan 16, 2025
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
26 changes: 17 additions & 9 deletions .github/workflows/assign_milestone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ on:
pull_request_target:
types: [opened]

permissions: read-all
permissions:
pull-requests: write
contents: read

env:
GH_TOKEN: ${{ github.token }}
Expand All @@ -13,18 +15,24 @@ jobs:
build:
name: Assign Milestone
runs-on: ubuntu-24.04
permissions:
pull-requests: write

steps:
- name: Checkout code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: Set up Go
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
go-version-file: go.mod
# We must explicitly checkout the base's SHA to avoid executing any code coming from
# the PR's SHA - Which would be executed in the base branch's context.
# This is really important to limit any sort of pwn requests.
ref: ${{ github.base_ref }}
persist-credentials: 'false'

- name: Assign Milestone
run: |
gh pr edit ${{ github.event.number }} --milestone "v$(sed -n 's/.*versionName.*\"\([[:digit:]\.]*\).*\"/\1/p' ./go/vt/servenv/version.go)"
# Ensure the content we sed from version.go is sanitized and match the correct format
VERSION=$(sed -n 's/.*versionName.*\"\([[:digit:]\.]*\).*\"/\1/p' ./go/vt/servenv/version.go)
if [[ ! "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Invalid version format: $VERSION"
exit 1
fi

gh pr edit ${{ github.event.number }} --milestone "v$VERSION"
5 changes: 4 additions & 1 deletion .github/workflows/auto_approve_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: 'false'

- name: Auto Approve Pull Request
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/check_make_vtadmin_authz_testgen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ jobs:

- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: 'false'

- name: Check for changes in relevant files
if: steps.skip-workflow.outputs.skip-workflow == 'false'
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/check_make_vtadmin_web_proto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ jobs:

- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: 'false'

- name: Check for changes in relevant files
if: steps.skip-workflow.outputs.skip-workflow == 'false'
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/cluster_endtoend_12.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ env:

jobs:
build:
timeout-minutes: 60
name: Run endtoend tests on Cluster (12)
runs-on: ubuntu-24.04

Expand Down Expand Up @@ -45,7 +46,9 @@ jobs:

- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: 'false'

- name: Check for changes in relevant files
if: steps.skip-workflow.outputs.skip-workflow == 'false'
Expand Down Expand Up @@ -92,6 +95,7 @@ jobs:

- name: Get dependencies
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
timeout-minutes: 10
run: |

# Get key to latest MySQL repo
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/cluster_endtoend_13.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ env:

jobs:
build:
timeout-minutes: 60
name: Run endtoend tests on Cluster (13)
runs-on: ubuntu-24.04

Expand Down Expand Up @@ -45,7 +46,9 @@ jobs:

- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: 'false'

- name: Check for changes in relevant files
if: steps.skip-workflow.outputs.skip-workflow == 'false'
Expand Down Expand Up @@ -92,6 +95,7 @@ jobs:

- name: Get dependencies
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
timeout-minutes: 10
run: |

# Get key to latest MySQL repo
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/cluster_endtoend_15.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ env:

jobs:
build:
timeout-minutes: 60
name: Run endtoend tests on Cluster (15)
runs-on: ubuntu-24.04

Expand Down Expand Up @@ -45,7 +46,9 @@ jobs:

- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: 'false'

- name: Check for changes in relevant files
if: steps.skip-workflow.outputs.skip-workflow == 'false'
Expand Down Expand Up @@ -92,6 +95,7 @@ jobs:

- name: Get dependencies
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
timeout-minutes: 10
run: |

# Get key to latest MySQL repo
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/cluster_endtoend_18.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ env:

jobs:
build:
timeout-minutes: 60
name: Run endtoend tests on Cluster (18)
runs-on: ubuntu-24.04

Expand Down Expand Up @@ -45,7 +46,9 @@ jobs:

- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: 'false'

- name: Check for changes in relevant files
if: steps.skip-workflow.outputs.skip-workflow == 'false'
Expand Down Expand Up @@ -92,6 +95,7 @@ jobs:

- name: Get dependencies
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
timeout-minutes: 10
run: |

# Get key to latest MySQL repo
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/cluster_endtoend_21.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ env:

jobs:
build:
timeout-minutes: 60
name: Run endtoend tests on Cluster (21)
runs-on: ubuntu-24.04

Expand Down Expand Up @@ -45,7 +46,9 @@ jobs:

- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: 'false'

- name: Check for changes in relevant files
if: steps.skip-workflow.outputs.skip-workflow == 'false'
Expand Down Expand Up @@ -92,6 +95,7 @@ jobs:

- name: Get dependencies
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
timeout-minutes: 10
run: |

# Get key to latest MySQL repo
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/cluster_endtoend_backup_pitr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ env:

jobs:
build:
timeout-minutes: 60
name: Run endtoend tests on Cluster (backup_pitr)
runs-on: ubuntu-24.04

Expand Down Expand Up @@ -45,7 +46,9 @@ jobs:

- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: 'false'

- name: Check for changes in relevant files
if: steps.skip-workflow.outputs.skip-workflow == 'false'
Expand Down Expand Up @@ -92,6 +95,7 @@ jobs:

- name: Get dependencies
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
timeout-minutes: 10
run: |

# Get key to latest MySQL repo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ env:

jobs:
build:
timeout-minutes: 60
name: Run endtoend tests on Cluster (backup_pitr_mysqlshell)
runs-on: ubuntu-24.04

Expand Down Expand Up @@ -45,7 +46,9 @@ jobs:

- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: 'false'

- name: Check for changes in relevant files
if: steps.skip-workflow.outputs.skip-workflow == 'false'
Expand Down Expand Up @@ -92,6 +95,7 @@ jobs:

- name: Get dependencies
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
timeout-minutes: 10
run: |

# Get key to latest MySQL repo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ env:

jobs:
build:
timeout-minutes: 60
name: Run endtoend tests on Cluster (backup_pitr_xtrabackup)
runs-on: ubuntu-24.04

Expand Down Expand Up @@ -45,7 +46,9 @@ jobs:

- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: 'false'

- name: Check for changes in relevant files
if: steps.skip-workflow.outputs.skip-workflow == 'false'
Expand Down Expand Up @@ -92,6 +95,7 @@ jobs:

- name: Get dependencies
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
timeout-minutes: 10
run: |

# Setup Percona Server for MySQL 8.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ env:

jobs:
build:
timeout-minutes: 60
name: Run endtoend tests on Cluster (ers_prs_newfeatures_heavy)
runs-on: ubuntu-24.04

Expand Down Expand Up @@ -45,7 +46,9 @@ jobs:

- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: 'false'

- name: Check for changes in relevant files
if: steps.skip-workflow.outputs.skip-workflow == 'false'
Expand Down Expand Up @@ -92,6 +95,7 @@ jobs:

- name: Get dependencies
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
timeout-minutes: 10
run: |

# Get key to latest MySQL repo
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/cluster_endtoend_mysql80.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ env:

jobs:
build:
timeout-minutes: 60
name: Run endtoend tests on Cluster (mysql80)
runs-on: ubuntu-24.04

Expand Down Expand Up @@ -45,7 +46,9 @@ jobs:

- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: 'false'

- name: Check for changes in relevant files
if: steps.skip-workflow.outputs.skip-workflow == 'false'
Expand Down Expand Up @@ -92,6 +95,7 @@ jobs:

- name: Get dependencies
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
timeout-minutes: 10
run: |

# Get key to latest MySQL repo
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/cluster_endtoend_mysql_server_vault.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ env:

jobs:
build:
timeout-minutes: 60
name: Run endtoend tests on Cluster (mysql_server_vault)
runs-on: ubuntu-24.04

Expand Down Expand Up @@ -45,7 +46,9 @@ jobs:

- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: 'false'

- name: Check for changes in relevant files
if: steps.skip-workflow.outputs.skip-workflow == 'false'
Expand Down Expand Up @@ -92,6 +95,7 @@ jobs:

- name: Get dependencies
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
timeout-minutes: 10
run: |

# Get key to latest MySQL repo
Expand Down
Loading
Loading