| 1 |
name: Update Google APIs Commit Hash |
| 2 |
|
| 3 |
on: |
| 4 |
schedule: |
| 5 |
- cron: '0 0 1 * *' |
| 6 |
workflow_dispatch: |
| 7 |
|
| 8 |
permissions: {} |
| 9 |
|
| 10 |
jobs: |
| 11 |
update_protobuf_version: |
| 12 |
name: Update protobuf includes to latest commit |
| 13 |
runs-on: ubuntu-latest |
| 14 |
permissions: |
| 15 |
contents: write # required for pushing commits to a branch |
| 16 |
pull-requests: write # required for creating a new PR |
| 17 |
|
| 18 |
steps: |
| 19 |
- name: Checkout code |
| 20 |
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 21 |
with: |
| 22 |
fetch-depth: 0 |
| 23 |
persist-credentials: true # zizmor: ignore[artipacked] |
| 24 |
|
| 25 |
- name: Extract latest commit hash from googleapis/googleapis and create PR |
| 26 |
env: |
| 27 |
RUN_ID: ${{ github.run_id }} |
| 28 |
GH_TOKEN: ${{ secrets.GOOGLEAPIS_SIGSTOREBOT_TOKEN }} |
| 29 |
run: | |
| 30 |
(cd /tmp && git clone --depth=1 https://github.com/googleapis/googleapis) |
| 31 |
export LATEST_COMMIT_HASH=$(cd /tmp/googleapis && git log -n 1 --format=%H) |
| 32 |
sed -i "s/^\(DEFAULT_GOOGLEAPIS_COMMIT\s*=\s*\).*/\1${LATEST_COMMIT_HASH}/" protoc-builder/versions.mk |
| 33 |
|
| 34 |
make all |
| 35 |
|
| 36 |
git config user.name "Sigstore Bot" |
| 37 |
git config user.email "[email protected]" |
| 38 |
git config --global --type bool push.autoSetupRemote true |
| 39 |
git add -A |
| 40 |
git checkout -b googleapis-${RUN_ID} |
| 41 |
git commit -sam "Update GOOGLEAPIS_COMMIT in versions.mk" |
| 42 |
git push |
| 43 |
gh pr create --title "build(deps): bump github.com/googleapis/googleapis to latest commit in protoc-builder/versions.mk" \ |
| 44 |
--body "This pull request updates the DEFAULT_GOOGLEAPIS_COMMIT variable in protoc-builder/versions.mk with the latest commit hash from the googleapis/googleapis repository." \ |
| 45 |
--base main \ |
| 46 |
--head googleapis-${RUN_ID} |
| 47 |
|
| 48 |
update_grpc_gateway_version: |
| 49 |
runs-on: ubuntu-latest |
| 50 |
name: Update gRPC Gateway OpenAPI v2 includes to latest commit |
| 51 |
permissions: |
| 52 |
contents: write # required for pushing commits to a branch |
| 53 |
pull-requests: write # required for creating a new PR |
| 54 |
|
| 55 |
steps: |
| 56 |
- name: Checkout code |
| 57 |
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 58 |
with: |
| 59 |
fetch-depth: 0 |
| 60 |
persist-credentials: true # zizmor: ignore[artipacked] |
| 61 |
|
| 62 |
- name: Extract latest commit hash from grpc-ecosystem/grpc-gateway and create PR |
| 63 |
env: |
| 64 |
RUN_ID: ${{ github.run_id }} |
| 65 |
GH_TOKEN: ${{ secrets.GOOGLEAPIS_SIGSTOREBOT_TOKEN }} |
| 66 |
run: | |
| 67 |
(cd /tmp && git clone --depth=1 https://github.com/grpc-ecosystem/grpc-gateway) |
| 68 |
export LATEST_COMMIT_HASH=$(cd /tmp/grpc-gateway && git log -n 1 --format=%H) |
| 69 |
sed -i "s/^\(DEFAULT_GRPC_GATEWAY_COMMIT\s*=\s*\).*/\1${LATEST_COMMIT_HASH}/" protoc-builder/versions.mk |
| 70 |
|
| 71 |
make all |
| 72 |
|
| 73 |
git config user.name "Sigstore Bot" |
| 74 |
git config user.email "[email protected]" |
| 75 |
git config --global --type bool push.autoSetupRemote true |
| 76 |
git add -A |
| 77 |
git checkout -b grpc-gateway-${RUN_ID} |
| 78 |
git commit -sam "Update GRPC_GATEWAY_COMMIT in versions.mk" |
| 79 |
git push |
| 80 |
gh pr create --title "build(deps): bump github.com/grpc-ecosystem/grpc-gateway to latest commit in protoc-builder/versions.mk" \ |
| 81 |
--body "This pull request updates the DEFAULT_GRPC_GATEWAY_COMMIT variable in protoc-builder/versions.mk with the latest commit hash from the grpc-ecosystem/grpc-gateway repository." \ |
| 82 |
--base main \ |
| 83 |
--head grpc-gateway-${RUN_ID} |