name: Update code-server on: workflow_dispatch: inputs: version: type: string required: true schedule: - cron: "0 16,21 * * *" jobs: # The org doesn't let GITHUB_TOKEN open pull requests, so the branch is pushed and the PR opened # as the coder-automations App. Its key signs only for this file on main, in the update # environment (main only). update: runs-on: ubuntu-latest environment: update permissions: contents: read id-token: write # Cloud KMS signs the coder-automations App's JWT env: TAG: ${{ inputs.version }} steps: - name: Fetch latest tag if: env.TAG == '' run: | tag=$(curl -fsSLI -o /dev/null -w "%{url_effective}" https://github.com/microsoft/vscode/releases/latest) tag="${tag#https://github.com/microsoft/vscode/releases/tag/}" echo "TAG=$tag" >> $GITHUB_ENV - name: Remove leading v from tag run: | echo "VERSION=${TAG#v}" >> $GITHUB_ENV - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6 with: submodules: true persist-credentials: false - name: Check current version id: check run: | commit="$(git -C lib/vscode rev-parse HEAD)" if [[ $(git -C lib/vscode ls-remote --tags | grep "$commit") == */"$VERSION" ]] ; then echo "$VERSION update has already been merged into $(git rev-parse --abbrev-ref HEAD)" echo done=true >> $GITHUB_OUTPUT elif git ls-remote --exit-code --heads origin "update/$VERSION" ; then echo "There is already a PR for updating to $VERSION" echo done=true >> $GITHUB_OUTPUT else echo "$VERSION update has not started yet" echo done=false >> $GITHUB_OUTPUT fi - uses: awalsh128/cache-apt-pkgs-action@553a35bb8ebd9fcabcb1c9451aa4c98e1b4ca8a9 # latest if: steps.check.outputs.done == 'false' with: packages: quilt version: 1.0 - run: ./ci/build/update-vscode.sh if: steps.check.outputs.done == 'false' # Minted after the update script so the token only exists for the push and the PR. - name: Generate coder-automations app token id: app_token if: steps.check.outputs.done == 'false' uses: coder/github-app-token-action@00eaec58ee1bfea9c8b48655b7ab7470b07739e5 # main 2026-11-17 with: client-id: ${{ secrets.CODER_AUTOMATION_APP_ID }} kms-key: ${{ secrets.CODER_AUTOMATION_APP_KMS_KEY }} workload-identity-provider: ${{ secrets.APP_KEYS_WORKLOAD_ID_PROVIDER }} owner: coder repositories: code-server permissions: | contents: write pull_requests: write - name: Open PR if: steps.check.outputs.done == 'false' env: GH_TOKEN: ${{ steps.app_token.outputs.token }} run: | gh auth setup-git git config --global user.name cdrci git config --global user.email opensource@coder.com git checkout -b "update/$VERSION" git add . git commit -m "Update Code to $VERSION" git push -u origin "$(git branch --show)" gh pr create \ --repo coder/code-server \ --title "Update Code to $VERSION" \ --body-file .cache/checklist \ --draft