Skip to content

*: harden update bazel files workflow permissions #1

*: harden update bazel files workflow permissions

*: harden update bazel files workflow permissions #1

name: Generate Bazel Files
on:
pull_request:
branches:
- master
types:
- opened
- synchronize
- reopened
- ready_for_review
permissions:
contents: read
concurrency:
group: generate-bazel-files-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
generate:
name: Generate Bazel Files
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
persist-credentials: false
- name: Build Prepare
uses: pingcap/tidb/.github/actions/tidb_build@fb17a419f54d51f45fd031d8e5069b7022ecec92
with:
bazelrc: ""
gcp_sa_key: ""
go-version: 1.25
- name: Run Bazel Prepare
shell: bash
run: |
#!/bin/bash
unset CI
sed -i '/bazel-cache/d' DEPS.bzl
sed -i '/ats.apps.svc/d' DEPS.bzl
sed -i '/bazel-cache/d' WORKSPACE
sed -i '/ats.apps.svc/d' WORKSPACE
make bazel_prepare
- name: Restore non-generated files
shell: bash
run: |
git restore --worktree --source=HEAD -- WORKSPACE
- name: Package Bazel Files
shell: bash
run: |
bash .github/scripts/package-bazel-files.sh bazel-artifact
- name: Upload Bazel Files Artifact
uses: actions/upload-artifact@v4
with:
name: bazel-files
path: bazel-artifact
if-no-files-found: error
retention-days: 1