github.com/grpc-ecosystem/grpc-gateway/v2@v2.19.1/.github/workflows/renovate.yml (about)

     1  on:
     2    push:
     3      branches:
     4        - renovate/*
     5  permissions:
     6    contents: read
     7  name: renovate
     8  jobs:
     9    update_repositoriesbzl:
    10      container:
    11        image: docker.pkg.github.com/grpc-ecosystem/grpc-gateway/build-env:1.19
    12        options: "--user root"
    13        credentials:
    14          username: ${{ github.actor }}
    15          password: ${{ secrets.GITHUB_TOKEN }}
    16      runs-on: ubuntu-latest
    17      steps:
    18        - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
    19          with:
    20            fetch-depth: 0
    21            token: ${{ secrets.GH_PUSH_TOKEN }}
    22        - uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4
    23          with:
    24            path: /home/vscode/.cache/_grpc_gateway_bazel
    25            key: v1-bazel-cache-${{ hashFiles('repositories.bzl') }}
    26            restore-keys: v1-bazel-cache-
    27        - name: Configure bazel
    28          run:
    29            | # put .bazelrc in $HOME so that it's read before project's .bazelrc
    30            cat > /home/vscode/.bazelrc << EOF
    31            startup --output_base /home/vscode/.cache/_grpc_gateway_bazel
    32            build --@io_bazel_rules_go//go/config:race
    33            # Workaround https://github.com/bazelbuild/bazel/issues/3645
    34            # See https://docs.bazel.build/versions/0.23.0/command-line-reference.html
    35            build --local_ram_resources=7168 # Github runners have 7G of memory
    36            build --local_cpu_resources=2    # Github runners have 2 vCPU
    37            EOF
    38        - run: bazel run //:gazelle -- update-repos -from_file=go.mod -to_macro=repositories.bzl%go_repositories
    39        - run: |
    40            git add .
    41            if output=$(git status --porcelain) && [ ! -z "$output" ]; then
    42              git config user.name "Renovate Bot"
    43              git config user.email "bot@renovateapp.com"
    44              git commit --amend --no-edit
    45              git push --force-with-lease origin ${{ github.ref_name }}
    46            fi
    47    regenerate:
    48      container:
    49        image: docker.pkg.github.com/grpc-ecosystem/grpc-gateway/build-env:1.19
    50        options: "--user root"
    51        credentials:
    52          username: ${{ github.actor }}
    53          password: ${{ secrets.GITHUB_TOKEN }}
    54      runs-on: ubuntu-latest
    55      needs:
    56        # Run after update_repositoriesbzl to avoid
    57        # git conflicts
    58        - update_repositoriesbzl
    59      steps:
    60        - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
    61          with:
    62            fetch-depth: 0
    63            token: ${{ secrets.GH_PUSH_TOKEN }}
    64        - run: make install
    65        - run: make clean
    66        - run: make generate
    67        - run: go mod tidy
    68        - run: |
    69            git add .
    70            if output=$(git status --porcelain) && [ ! -z "$output" ]; then
    71              git config user.name "Renovate Bot"
    72              git config user.email "bot@renovateapp.com"
    73              git commit --amend --no-edit
    74              git push --force-with-lease origin ${{ github.ref_name }}
    75            fi