From 37d64bf27f91273b16c3400bade0d3c3177bff50 Mon Sep 17 00:00:00 2001 From: svenvanderburg <9945255+svenvanderburg@users.noreply.github.com> Date: Tue, 17 Nov 2026 07:33:35 +0000 Subject: [PATCH] [actions] update sandpaper workflow to version v1.0.4 --- .github/workflows/README.md | 13 ++++--- .github/workflows/docker_apply_cache.yaml | 3 ++ .github/workflows/docker_build_deploy.yaml | 7 ++-- .github/workflows/update-cache.yaml | 4 +-- .github/workflows/update-workflows.yaml | 40 +++++++++++++++++++++- .github/workflows/workflows-version.txt | 2 +- 6 files changed, 59 insertions(+), 10 deletions(-) diff --git a/.github/workflows/README.md b/.github/workflows/README.md index 4516bb1..2017fc4 100644 --- a/.github/workflows/README.md +++ b/.github/workflows/README.md @@ -196,12 +196,17 @@ Repository-level variables for this workflow are: - Force a reset of previously build markdown files - Setting this variable value to `true` will force sandpaper to delete any previously build markdown files - Default is unset or `false` +- OMIT_PR_CONTAINER_VERSION_UPDATE + - Control raise behaviour of the workbench-docker version update PR + - When a new workbench Docker image version is detected, usually after a sandpaper, varnish, or pegboard update, its version number will be incremented + - If a newer version is available, a PR will be raised that updates the `.github/workbench-docker-version.txt` file + - To not raise this PR set this to `true` + - Default is unset or `false` - AUTO_MERGE_WORKBENCH_VERSION_UPDATE - Control merge behaviour of the workbench-docker version update PR - - When a new workbench Docker image version is detected, usually after a sandpaper, varnish, or pegboard update, its version number will be incremented - - If a newer version is available, a PR will be auto-generated that updates the `.github/workbench-docker-version.txt` file, and this PR will be auto-merged - - To not auto-merge this PR and to choose when to update the Docker version used, set this to `false`. - - Default is unset or `true` + - If OMIT_PR_CONTAINER_VERSION_UPDATE is `true` this option does nothing + - To auto-merge this PR, set this to `true` + - Default is unset or `false` - LANG_CODE - Two-letter language code that triggers the use of Joel Nitta's {dovetail} package for lesson translation - This is used in the internationalisation repos of the main Carpentry lesson programs diff --git a/.github/workflows/docker_apply_cache.yaml b/.github/workflows/docker_apply_cache.yaml index dcebb3b..9c44f5b 100644 --- a/.github/workflows/docker_apply_cache.yaml +++ b/.github/workflows/docker_apply_cache.yaml @@ -154,6 +154,9 @@ jobs: name: "Prune Dependency Images" runs-on: ubuntu-latest needs: check-renv + permissions: + contents: read + packages: write steps: - name: Prune any old dependency image layers uses: carpentries/actions/prune-dependency-images@v1 diff --git a/.github/workflows/docker_build_deploy.yaml b/.github/workflows/docker_build_deploy.yaml index bb0d0fd..8a33d8c 100644 --- a/.github/workflows/docker_build_deploy.yaml +++ b/.github/workflows/docker_build_deploy.yaml @@ -8,6 +8,7 @@ on: paths-ignore: - '.github/workflows/**.yaml' - '.github/workbench-docker-version.txt' + - '.devcontainer' schedule: - cron: '0 0 * * 2' workflow_run: @@ -37,7 +38,7 @@ on: # only one build/deploy at a time concurrency: - group: docker-build-deploy + group: docker-build-deploy-${{ github.event_name }} cancel-in-progress: true jobs: @@ -95,6 +96,7 @@ jobs: RENV_PATHS_ROOT: /home/rstudio/lesson/renv RENV_PROFILE: "lesson-requirements" RENV_CONFIG_EXTERNAL_LIBRARIES: "/usr/local/lib/R/site-library" + WORKBENCH_OVERLAY_CUSTOMIZATION: ${{ vars.WORKBENCH_OVERLAY_CUSTOMIZATION || '' }} volumes: - ${{ github.workspace }}:/home/rstudio/lesson options: --cpus 1 @@ -144,7 +146,8 @@ jobs: uses: carpentries/actions/record-container-version@v1 with: CONTAINER_VER: ${{ needs.preflight.outputs.wb-vers }} - AUTO_MERGE: ${{ vars.AUTO_MERGE_CONTAINER_VERSION_UPDATE || 'true' }} + OMIT_PR: ${{ vars.OMIT_PR_CONTAINER_VERSION_UPDATE || 'false' }} + AUTO_MERGE: ${{ vars.AUTO_MERGE_CONTAINER_VERSION_UPDATE || 'false' }} token: ${{ secrets.GITHUB_TOKEN }} role-to-assume: ${{ secrets.AWS_GH_OIDC_ARN }} aws-region: ${{ secrets.AWS_GH_OIDC_REGION }} diff --git a/.github/workflows/update-cache.yaml b/.github/workflows/update-cache.yaml index b711f2d..aafd761 100644 --- a/.github/workflows/update-cache.yaml +++ b/.github/workflows/update-cache.yaml @@ -74,7 +74,7 @@ jobs: update_cache: name: "Create Package Update Pull Request" - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest needs: check-renv permissions: contents: write @@ -95,7 +95,7 @@ jobs: uses: r-lib/actions/setup-r@v2 with: use-public-rspm: true - install-r: false + install-r: true - name: "Update {renv} deps and determine if a PR is needed" id: update diff --git a/.github/workflows/update-workflows.yaml b/.github/workflows/update-workflows.yaml index 6d63a32..632435d 100644 --- a/.github/workflows/update-workflows.yaml +++ b/.github/workflows/update-workflows.yaml @@ -18,6 +18,11 @@ on: description: 'Workflow files/file extensions to clean (no wildcards, enter "" for none)' required: false default: '.yaml' + clean-devc: + description: 'Clean devcontainer files' + required: false + default: true + type: boolean jobs: update_workflow: @@ -25,8 +30,9 @@ jobs: runs-on: ubuntu-latest permissions: contents: write - pull-requests: write id-token: write + packages: read + pull-requests: write steps: - name: "Checkout Repository" uses: actions/checkout@v6 @@ -115,3 +121,35 @@ jobs: [1]: https://github.com/carpentries/create-pull-request/tree/main labels: "type: workflows" draft: false + + - name: Update devcontainer + id: update-devcontainer + if: ${{ steps.validate-token.outputs.wf == 'true' }} + uses: carpentries/actions/update-devcontainer@v1 + with: + token: ${{ steps.set-pat.outputs.pat || secrets.SANDPAPER_WORKFLOW }} + repo: ${{ github.repository }} + clean: ${{ github.event.inputs.clean-devc || 'true' }} + + - name: Create Devcontainer Pull Request + id: cdpr + if: | + steps.update-devcontainer.outputs.repo-package-ref && + steps.validate-token.outputs.wf == 'true' + uses: carpentries/create-pull-request@main + with: + token: ${{ steps.set-pat.outputs.pat || secrets.SANDPAPER_WORKFLOW }} + delete-branch: true + branch: "update/devcontainer" + commit-message: "[actions] update devcontainer to version ${{ steps.update-devcontainer.outputs.repo-package-ref }}" + title: "Update Devcontainer to Version ${{ steps.update-devcontainer.outputs.repo-package-ref }}" + body: | + :robot: This is an automated build + + Set devcontainer spec to: ${{ steps.update-devcontainer.outputs.repo-package-ref }} + + - Auto-generated by [create-pull-request][1] on ${{ steps.update-devcontainer.outputs.date }} + + [1]: https://github.com/carpentries/create-pull-request/tree/main + labels: "type: workflows" + draft: false diff --git a/.github/workflows/workflows-version.txt b/.github/workflows/workflows-version.txt index 570c796..3e7bcf0 100644 --- a/.github/workflows/workflows-version.txt +++ b/.github/workflows/workflows-version.txt @@ -1 +1 @@ -v1.0.2 +v1.0.4