Update Chrome version to latest stable #86
This file contains hidden or 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 Chrome version to latest stable | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: "0 0 * * *" # Run every day at midnight | |
| jobs: | |
| check-for-updates: | |
| name: Check for Chrome stable | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Get the latest Chrome stable | |
| run: | | |
| curl -s --request GET \ | |
| --url "https://googlechromelabs.github.io/chrome-for-testing/last-known-good-versions.json" \ | |
| > chrome-release.json | |
| - name: Extract the latest Chrome stable version | |
| run: echo "LATEST_CHROME_VERSION=$(jq -r '.channels.Stable.version' chrome-release.json)" >> $GITHUB_ENV | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 2 | |
| - name: Extract the current chrome version from Dockerfile | |
| run: echo "CURRENT_CHROME_VERSION=$(sed -n 's/ARG CHROME_VERSION=//p' src/worker/Dockerfile)" >> $GITHUB_ENV | |
| - name: Compare the versions | |
| run: echo "NEEDS_UPDATE=$(dpkg --compare-versions ${{ env.LATEST_CHROME_VERSION }} gt ${{ env.CURRENT_CHROME_VERSION }} && echo true || echo false)" >> $GITHUB_ENV | |
| - name: Update the Chrome version | |
| if: ${{ env.NEEDS_UPDATE == 'true' }} | |
| run: | | |
| sed -i "s/ARG CHROME_VERSION=.*/ARG CHROME_VERSION=${LATEST_CHROME_VERSION}/" src/worker/Dockerfile | |
| - name: Create PR with the update | |
| if: ${{ env.NEEDS_UPDATE == 'true' }} | |
| uses: peter-evans/create-pull-request@v7 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| add-paths: "docker/app/Dockerfile" | |
| commit-message: "Update Chrome to version ${{ env.LATEST_CHROME_VERSION }}" | |
| title: "Bump Chrome from ${{ env.CURRENT_CHROME_VERSION }} to ${{ env.LATEST_CHROME_VERSION }}" | |
| labels: "dependencies" | |
| body: | | |
| Bumps Chrome from ${{ env.CURRENT_CHROME_VERSION }} to ${{ env.LATEST_CHROME_VERSION }} | |
| ## Automated Update | |
| This PR was automatically generated by the Chrome update workflow. | |
| branch: "update-chrome-${{ env.LATEST_CHROME_VERSION }}" |