Update Google APIs Commit Hash #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update Google APIs Commit Hash | |
on: | |
schedule: | |
- cron: '0 0 1 * *' | |
workflow_dispatch: | |
permissions: {} | |
jobs: | |
update_protobuf_version: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
pull-requests: write | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
fetch-depth: 0 | |
persist-credentials: true | |
- name: Extract latest commit hash from googleapis/googleapis and create PR | |
env: | |
RUN_ID: ${{ github.run_id }} | |
GH_TOKEN: ${{ secrets.GOOGLEAPIS_SIGSTOREBOT_TOKEN }} | |
run: | | |
(cd /tmp && git clone --depth=1 https://github.com/googleapis/googleapis) | |
export LATEST_COMMIT_HASH=$(cd /tmp/googleapis && git log -n 1 --format=%H) | |
sed -i "s/^\(DEFAULT_GOOGLEAPIS_COMMIT\s*=\s*\).*/\1${LATEST_COMMIT_HASH}/" protoc-builder/versions.mk | |
make all | |
git config user.name "Sigstore Bot" | |
git config user.email "[email protected]" | |
git config --global --type bool push.autoSetupRemote true | |
git add -A | |
git checkout -b googleapis-${RUN_ID} | |
git commit -sam "Update GOOGLEAPIS_COMMIT in versions.mk" | |
git push | |
gh pr create --title "build(deps): bump github.com/googleapis/googleapis to latest commit in protoc-builder/versions.mk" \ | |
--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." \ | |
--base main \ | |
--head googleapis-${RUN_ID} |