High performance self-hosted photo and video management solution.
TypeScript backup-toolfluttergoogle-photosgoogle-photos-alternativejavascriptmobile-appnestjsnodejsphoto-galleryphotosphotos-managementself-hostedsveltesveltekittypescriptvideos
fix: various actions workflow security improvements (#17651)
bo0tzz504930947d62
diff --git a/.github/workflows/build-mobile.yml b/.github/workflows/build-mobile.ymlindex 406e8f89e1..7217b5267e 100644--- a/.github/workflows/build-mobile.yml+++ b/.github/workflows/build-mobile.yml@@ -7,6 +7,15 @@ on:ref:required: falsetype: string+ secrets:+ KEY_JKS:+ required: true+ ALIAS:+ required: true+ ANDROID_KEY_PASSWORD:+ required: true+ ANDROID_STORE_PASSWORD:+ required: truepull_request:push:branches: [main]@@ -15,14 +24,21 @@ concurrency:group: ${{ github.workflow }}-${{ github.ref }}cancel-in-progress: true+permissions: {}+jobs:pre-job:runs-on: ubuntu-latest+ permissions:+ contents: readoutputs:should_run: ${{ steps.found_paths.outputs.mobile == 'true' || steps.should_force.outputs.should_force == 'true' }}steps:- name: Checkout codeuses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4+ with:+ persist-credentials: false+- id: found_pathsuses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3with:@@ -38,22 +54,17 @@ jobs:build-sign-android:name: Build and sign Androidneeds: pre-job+ permissions:+ contents: read# Skip when PR from a forkif: ${{ !github.event.pull_request.head.repo.fork && github.actor != 'dependabot[bot]' && needs.pre-job.outputs.should_run == 'true' }}runs-on: macos-14steps:- - name: Determine ref- id: get-ref- run: |- input_ref="${{ inputs.ref }}"- github_ref="${{ github.sha }}"- ref="${input_ref:-$github_ref}"- echo "ref=$ref" >> $GITHUB_OUTPUT-- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4with:- ref: ${{ steps.get-ref.outputs.ref }}+ ref: ${{ inputs.ref || github.sha }}+ persist-credentials: false- uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4with:diff --git a/.github/workflows/cache-cleanup.yml b/.github/workflows/cache-cleanup.ymlindex 0cc73c46c3..84adde08cf 100644--- a/.github/workflows/cache-cleanup.yml+++ b/.github/workflows/cache-cleanup.yml@@ -8,31 +8,38 @@ concurrency:group: ${{ github.workflow }}-${{ github.ref }}cancel-in-progress: true+permissions: {}+jobs:cleanup:name: Cleanupruns-on: ubuntu-latest+ permissions:+ contents: read+ actions: writesteps:- name: Check out codeuses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4+ with:+ persist-credentials: false- name: Cleanup+ env:+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}+ REF: ${{ github.ref }}run: |gh extension install actions/gh-actions-cacheREPO=${{ github.repository }}- BRANCH=${{ github.ref }}echo "Fetching list of cache keys"- cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH -L 100 | cut -f 1 )+ cacheKeysForPR=$(gh actions-cache list -R $REPO -B ${REF} -L 100 | cut -f 1 )## Setting this to not fail the workflow while deleting cache keys.set +eecho "Deleting caches..."for cacheKey in $cacheKeysForPRdo- gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm+ gh actions-cache delete $cacheKey -R "$REPO" -B "${REF}" --confirmdoneecho "Done"- env:- GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}diff --git a/.github/workflows/cli.yml b/.github/workflows/cli.ymlindex 05326d063e..231ad141e4 100644--- a/.github/workflows/cli.yml+++ b/.github/workflows/cli.yml@@ -16,19 +16,23 @@ concurrency:group: ${{ github.workflow }}-${{ github.ref }}cancel-in-progress: true-permissions:- packages: write+permissions: {}jobs:publish:name: CLI Publishruns-on: ubuntu-latest+ permissions:+ contents: readdefaults:run:working-directory: ./clisteps:- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4+ with:+ persist-credentials: false+# Setup .npmrc file to publish to npm- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4with:@@ -48,11 +52,16 @@ jobs:docker:name: Dockerruns-on: ubuntu-latest+ permissions:+ contents: read+ packages: writeneeds: publishsteps:- name: Checkoutuses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4+ with:+ persist-credentials: false- name: Set up QEMUuses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.ymlindex 99ffee2e88..7d07785de7 100644--- a/.github/workflows/codeql-analysis.yml+++ b/.github/workflows/codeql-analysis.yml@@ -24,6 +24,8 @@ concurrency:group: ${{ github.workflow }}-${{ github.ref }}cancel-in-progress: true+permissions: {}+jobs:analyze:name: Analyze@@ -43,6 +45,8 @@ jobs:steps:- name: Checkout repositoryuses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4+ with:+ persist-credentials: false# Initializes the CodeQL tools for scanning.- name: Initialize CodeQLdiff --git a/.github/workflows/docker.yml b/.github/workflows/docker.ymlindex d1bdb5e8e7..a78d3c25dc 100644--- a/.github/workflows/docker.yml+++ b/.github/workflows/docker.yml@@ -12,18 +12,21 @@ concurrency:group: ${{ github.workflow }}-${{ github.ref }}cancel-in-progress: true-permissions:- packages: write+permissions: {}jobs:pre-job:runs-on: ubuntu-latest+ permissions:+ contents: readoutputs:should_run_server: ${{ steps.found_paths.outputs.server == 'true' || steps.should_force.outputs.should_force == 'true' }}should_run_ml: ${{ steps.found_paths.outputs.machine-learning == 'true' || steps.should_force.outputs.should_force == 'true' }}steps:- name: Checkout codeuses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4+ with:+ persist-credentials: false- id: found_pathsuses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3with:@@ -45,6 +48,9 @@ jobs:retag_ml:name: Re-Tag MLneeds: pre-job+ permissions:+ contents: read+ packages: writeif: ${{ needs.pre-job.outputs.should_run_ml == 'false' && !github.event.pull_request.head.repo.fork }}runs-on: ubuntu-lateststrategy:@@ -58,18 +64,22 @@ jobs:username: ${{ github.repository_owner }}password: ${{ secrets.GITHUB_TOKEN }}- name: Re-tag image+ env:+ REGISTRY_NAME: 'ghcr.io'+ REPOSITORY: ${{ github.repository_owner }}/immich-machine-learning+ TAG_OLD: main${{ matrix.suffix }}+ TAG_PR: ${{ github.event.number == 0 && github.ref_name || format('pr-{0}', github.event.number) }}${{ matrix.suffix }}+ TAG_COMMIT: commit-${{ github.event_name != 'pull_request' && github.sha || github.event.pull_request.head.sha }}${{ matrix.suffix }}run: |- REGISTRY_NAME="ghcr.io"- REPOSITORY=${{ github.repository_owner }}/immich-machine-learning- TAG_OLD=main${{ matrix.suffix }}- TAG_PR=${{ github.event.number == 0 && github.ref_name || format('pr-{0}', github.event.number) }}${{ matrix.suffix }}- TAG_COMMIT=commit-${{ github.event_name != 'pull_request' && github.sha || github.event.pull_request.head.sha }}${{ matrix.suffix }}- docker buildx imagetools create -t $REGISTRY_NAME/$REPOSITORY:$TAG_PR $REGISTRY_NAME/$REPOSITORY:$TAG_OLD- docker buildx imagetools create -t $REGISTRY_NAME/$REPOSITORY:$TAG_COMMIT $REGISTRY_NAME/$REPOSITORY:$TAG_OLD+ docker buildx imagetools create -t "${REGISTRY_NAME}/${REPOSITORY}:${TAG_PR}" "${REGISTRY_NAME}/${REPOSITORY}:${TAG_OLD}"+ docker buildx imagetools create -t "${REGISTRY_NAME}/${REPOSITORY}:${TAG_COMMIT}" "${REGISTRY_NAME}/${REPOSITORY}:${TAG_OLD}"retag_server:name: Re-Tag Serverneeds: pre-job+ permissions:+ contents: read+ packages: writeif: ${{ needs.pre-job.outputs.should_run_server == 'false' && !github.event.pull_request.head.repo.fork }}runs-on: ubuntu-lateststrategy:@@ -83,18 +93,22 @@ jobs:username: ${{ github.repository_owner }}password: ${{ secrets.GITHUB_TOKEN }}- name: Re-tag image+ env:+ REGISTRY_NAME: 'ghcr.io'+ REPOSITORY: ${{ github.repository_owner }}/immich-server+ TAG_OLD: main${{ matrix.suffix }}+ TAG_PR: ${{ github.event.number == 0 && github.ref_name || format('pr-{0}', github.event.number) }}${{ matrix.suffix }}+ TAG_COMMIT: commit-${{ github.event_name != 'pull_request' && github.sha || github.event.pull_request.head.sha }}${{ matrix.suffix }}run: |- REGISTRY_NAME="ghcr.io"- REPOSITORY=${{ github.repository_owner }}/immich-server- TAG_OLD=main${{ matrix.suffix }}- TAG_PR=${{ github.event.number == 0 && github.ref_name || format('pr-{0}', github.event.number) }}${{ matrix.suffix }}- TAG_COMMIT=commit-${{ github.event_name != 'pull_request' && github.sha || github.event.pull_request.head.sha }}${{ matrix.suffix }}- docker buildx imagetools create -t $REGISTRY_NAME/$REPOSITORY:$TAG_PR $REGISTRY_NAME/$REPOSITORY:$TAG_OLD- docker buildx imagetools create -t $REGISTRY_NAME/$REPOSITORY:$TAG_COMMIT $REGISTRY_NAME/$REPOSITORY:$TAG_OLD+ docker buildx imagetools create -t "${REGISTRY_NAME}/${REPOSITORY}:${TAG_PR}" "${REGISTRY_NAME}/${REPOSITORY}:${TAG_OLD}"+ docker buildx imagetools create -t "${REGISTRY_NAME}/${REPOSITORY}:${TAG_COMMIT}" "${REGISTRY_NAME}/${REPOSITORY}:${TAG_OLD}"build_and_push_ml:name: Build and Push MLneeds: pre-job+ permissions:+ contents: read+ packages: writeif: ${{ needs.pre-job.outputs.should_run_ml == 'true' }}runs-on: ${{ matrix.runner }}env:@@ -148,6 +162,8 @@ jobs:- name: Checkoutuses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4+ with:+ persist-credentials: false- name: Set up Docker Buildxuses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0@@ -161,11 +177,14 @@ jobs:password: ${{ secrets.GITHUB_TOKEN }}- name: Generate cache key suffix+ env:+ REF: ${{ github.ref_name }}run: |if [[ "${{ github.event_name }}" == "pull_request" ]]; thenecho "CACHE_KEY_SUFFIX=pr-${{ github.event.number }}" >> $GITHUB_ENVelse- echo "CACHE_KEY_SUFFIX=$(echo ${{ github.ref_name }} | sed 's/[^a-zA-Z0-9]/-/g')" >> $GITHUB_ENV+ SUFFIX=$(echo "${REF}" | sed 's/[^a-zA-Z0-9]/-/g')+ echo "CACHE_KEY_SUFFIX=${SUFFIX}" >> $GITHUB_ENVfi- name: Generate cache target@@ -175,7 +194,7 @@ jobs:# Essentially just ignore the cache output (forks can't write to registry cache)echo "cache-to=type=local,dest=/tmp/discard,ignore-error=true" >> $GITHUB_OUTPUTelse- echo "cache-to=type=registry,ref=${{ env.GHCR_REPO }}-build-cache:${{ env.PLATFORM_PAIR }}-${{ matrix.device }}-${{ env.CACHE_KEY_SUFFIX }},mode=max,compression=zstd" >> $GITHUB_OUTPUT+ echo "cache-to=type=registry,ref=${GHCR_REPO}-build-cache:${PLATFORM_PAIR}-${{ matrix.device }}-${CACHE_KEY_SUFFIX},mode=max,compression=zstd" >> $GITHUB_OUTPUTfi- name: Generate docker image tags@@ -221,6 +240,10 @@ jobs:merge_ml:name: Merge & Push MLruns-on: ubuntu-latest+ permissions:+ contents: read+ actions: read+ packages: writeif: ${{ needs.pre-job.outputs.should_run_ml == 'true' && !github.event.pull_request.head.repo.fork }}env:GHCR_REPO: ghcr.io/${{ github.repository_owner }}/immich-machine-learning@@ -308,15 +331,16 @@ jobs:fiTAGS=$(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \- SOURCE_ARGS=$(printf '${{ env.GHCR_REPO }}@sha256:%s ' *)-- echo "docker buildx imagetools create $TAGS "${ANNOTATIONS[@]}" $SOURCE_ARGS"+ SOURCE_ARGS=$(printf "${GHCR_REPO}@sha256:%s " *)docker buildx imagetools create $TAGS "${ANNOTATIONS[@]}" $SOURCE_ARGSbuild_and_push_server:name: Build and Push Serverruns-on: ${{ matrix.runner }}+ permissions:+ contents: read+ packages: writeneeds: pre-jobif: ${{ needs.pre-job.outputs.should_run_server == 'true' }}env:@@ -340,6 +364,8 @@ jobs:- name: Checkoutuses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4+ with:+ persist-credentials: false- name: Set up Docker Buildxuses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3@@ -353,11 +379,14 @@ jobs:password: ${{ secrets.GITHUB_TOKEN }}- name: Generate cache key suffix+ env:+ REF: ${{ github.ref_name }}run: |if [[ "${{ github.event_name }}" == "pull_request" ]]; thenecho "CACHE_KEY_SUFFIX=pr-${{ github.event.number }}" >> $GITHUB_ENVelse- echo "CACHE_KEY_SUFFIX=$(echo ${{ github.ref_name }} | sed 's/[^a-zA-Z0-9]/-/g')" >> $GITHUB_ENV+ SUFFIX=$(echo "${REF}" | sed 's/[^a-zA-Z0-9]/-/g')+ echo "CACHE_KEY_SUFFIX=${SUFFIX}" >> $GITHUB_ENVfi- name: Generate cache target@@ -367,7 +396,7 @@ jobs:# Essentially just ignore the cache output (forks can't write to registry cache)echo "cache-to=type=local,dest=/tmp/discard,ignore-error=true" >> $GITHUB_OUTPUTelse- echo "cache-to=type=registry,ref=${{ env.GHCR_REPO }}-build-cache:${{ env.PLATFORM_PAIR }}-${{ env.CACHE_KEY_SUFFIX }},mode=max,compression=zstd" >> $GITHUB_OUTPUT+ echo "cache-to=type=registry,ref=${GHCR_REPO}-build-cache:${PLATFORM_PAIR}-${CACHE_KEY_SUFFIX},mode=max,compression=zstd" >> $GITHUB_OUTPUTfi- name: Generate docker image tags@@ -413,6 +442,10 @@ jobs:merge_server:name: Merge & Push Serverruns-on: ubuntu-latest+ permissions:+ contents: read+ actions: read+ packages: writeif: ${{ needs.pre-job.outputs.should_run_server == 'true' && !github.event.pull_request.head.repo.fork }}env:GHCR_REPO: ghcr.io/${{ github.repository_owner }}/immich-server@@ -486,15 +519,14 @@ jobs:fiTAGS=$(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \- SOURCE_ARGS=$(printf '${{ env.GHCR_REPO }}@sha256:%s ' *)-- echo "docker buildx imagetools create $TAGS "${ANNOTATIONS[@]}" $SOURCE_ARGS"+ SOURCE_ARGS=$(printf "${GHCR_REPO}@sha256:%s " *)docker buildx imagetools create $TAGS "${ANNOTATIONS[@]}" $SOURCE_ARGSsuccess-check-server:name: Docker Build & Push Server Successneeds: [merge_server, retag_server]+ permissions: {}runs-on: ubuntu-latestif: always()steps:@@ -508,6 +540,7 @@ jobs:success-check-ml:name: Docker Build & Push ML Successneeds: [merge_ml, retag_ml]+ permissions: {}runs-on: ubuntu-latestif: always()steps:diff --git a/.github/workflows/docs-build.yml b/.github/workflows/docs-build.ymlindex fdd30034ee..ece3bbd248 100644--- a/.github/workflows/docs-build.yml+++ b/.github/workflows/docs-build.yml@@ -10,14 +10,20 @@ concurrency:group: ${{ github.workflow }}-${{ github.ref }}cancel-in-progress: true+permissions: {}+jobs:pre-job:runs-on: ubuntu-latest+ permissions:+ contents: readoutputs:should_run: ${{ steps.found_paths.outputs.docs == 'true' || steps.should_force.outputs.should_force == 'true' }}steps:- name: Checkout codeuses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4+ with:+ persist-credentials: false- id: found_pathsuses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3with:@@ -33,6 +39,8 @@ jobs:build:name: Docs Buildneeds: pre-job+ permissions:+ contents: readif: ${{ needs.pre-job.outputs.should_run == 'true' }}runs-on: ubuntu-latestdefaults:@@ -42,6 +50,8 @@ jobs:steps:- name: Checkout codeuses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4+ with:+ persist-credentials: false- name: Setup Nodeuses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4diff --git a/.github/workflows/docs-deploy.yml b/.github/workflows/docs-deploy.ymlindex f33c0c4c03..10277a0c5e 100644--- a/.github/workflows/docs-deploy.yml+++ b/.github/workflows/docs-deploy.yml@@ -9,6 +9,9 @@ jobs:checks:name: Docs Deploy Checksruns-on: ubuntu-latest+ permissions:+ actions: read+ pull-requests: readoutputs:parameters: ${{ steps.parameters.outputs.result }}artifact: ${{ steps.get-artifact.outputs.result }}@@ -36,6 +39,8 @@ jobs:- name: Determine deploy parametersid: parametersuses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7+ env:+ HEAD_SHA: ${{ github.event.workflow_run.head_sha }}with:script: |const eventType = context.payload.workflow_run.event;@@ -57,7 +62,8 @@ jobs:} else if (eventType == "pull_request") {let pull_number = context.payload.workflow_run.pull_requests[0]?.number;if(!pull_number) {- const response = await github.rest.search.issuesAndPullRequests({q: 'repo:${{ github.repository }} is:pr sha:${{ github.event.workflow_run.head_sha }}',per_page: 1,})+ const {HEAD_SHA} = process.env;+ const response = await github.rest.search.issuesAndPullRequests({q: `repo:${{ github.repository }} is:pr sha:${HEAD_SHA}`,per_page: 1,})const items = response.data.itemsif (items.length < 1) {throw new Error("No pull request found for the commit")@@ -95,10 +101,16 @@ jobs:name: Docs Deployruns-on: ubuntu-latestneeds: checks+ permissions:+ contents: read+ actions: read+ pull-requests: writeif: ${{ fromJson(needs.checks.outputs.artifact).found && fromJson(needs.checks.outputs.parameters).shouldDeploy }}steps:- name: Checkout codeuses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4+ with:+ persist-credentials: false- name: Load parametersid: parameters@@ -162,9 +174,11 @@ jobs:- name: Output Cleaningid: clean+ env:+ TG_OUTPUT: ${{ steps.docs-output.outputs.tg_action_output }}run: |- TG_OUT=$(echo '${{ steps.docs-output.outputs.tg_action_output }}' | sed 's|%0A|\n|g ; s|%3C|<|g' | jq -c .)- echo "output=$TG_OUT" >> $GITHUB_OUTPUT+ CLEANED=$(echo "$TG_OUTPUT" | sed 's|%0A|\n|g ; s|%3C|<|g' | jq -c .)+ echo "output=$CLEANED" >> $GITHUB_OUTPUT- name: Publish to Cloudflare Pagesuses: cloudflare/pages-action@f0a1cd58cd66095dee69bfa18fa5efd1dde93bca # v1diff --git a/.github/workflows/docs-destroy.yml b/.github/workflows/docs-destroy.ymlindex 99499528b6..9d1e4b6612 100644--- a/.github/workflows/docs-destroy.yml+++ b/.github/workflows/docs-destroy.yml@@ -3,13 +3,20 @@ on:pull_request_target:types: [closed]+permissions: {}+jobs:deploy:name: Docs Destroyruns-on: ubuntu-latest+ permissions:+ contents: read+ pull-requests: writesteps:- name: Checkout codeuses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4+ with:+ persist-credentials: false- name: Destroy Docs Subdomainenv:diff --git a/.github/workflows/fix-format.yml b/.github/workflows/fix-format.ymlindex 9c52691a52..77b86cb0b8 100644--- a/.github/workflows/fix-format.yml+++ b/.github/workflows/fix-format.yml@@ -4,11 +4,14 @@ on:pull_request:types: [labeled]+permissions: {}+jobs:fix-formatting:runs-on: ubuntu-latestif: ${{ github.event.label.name == 'fix:formatting' }}permissions:+ contents: writepull-requests: writesteps:- name: Generate a token@@ -23,6 +26,7 @@ jobs:with:ref: ${{ github.event.pull_request.head.ref }}token: ${{ steps.generate-token.outputs.token }}+ persist-credentials: true- name: Setup Nodeuses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4diff --git a/.github/workflows/pr-label-validation.yml b/.github/workflows/pr-label-validation.ymlindex 247c625a96..8d34597a08 100644--- a/.github/workflows/pr-label-validation.yml+++ b/.github/workflows/pr-label-validation.yml@@ -4,6 +4,8 @@ on:pull_request_target:types: [opened, labeled, unlabeled, synchronize]+permissions: {}+jobs:validate-release-label:runs-on: ubuntu-latestdiff --git a/.github/workflows/pr-labeler.yml b/.github/workflows/pr-labeler.ymlindex 1b43c89889..5704f4275f 100644--- a/.github/workflows/pr-labeler.yml+++ b/.github/workflows/pr-labeler.yml@@ -2,6 +2,8 @@ name: 'Pull Request Labeler'on:- pull_request_target+permissions: {}+jobs:labeler:permissions:diff --git a/.github/workflows/pr-require-conventional-commit.yml b/.github/workflows/pr-require-conventional-commit.ymlindex 20dd0492f4..78ba77495c 100644--- a/.github/workflows/pr-require-conventional-commit.yml+++ b/.github/workflows/pr-require-conventional-commit.yml@@ -4,9 +4,13 @@ on:pull_request:types: [opened, synchronize, reopened, edited]+permissions: {}+jobs:validate-pr-title:runs-on: ubuntu-latest+ permissions:+ pull-requests: writesteps:- name: PR Conventional Commit Validationuses: ytanikin/PRConventionalCommits@b628c5a234cc32513014b7bfdd1e47b532124d98 # 1.3.0diff --git a/.github/workflows/prepare-release.yml b/.github/workflows/prepare-release.ymlindex ffb24d8952..7971f7574a 100644--- a/.github/workflows/prepare-release.yml+++ b/.github/workflows/prepare-release.yml@@ -21,13 +21,14 @@ concurrency:group: ${{ github.workflow }}-${{ github.ref }}-rootcancel-in-progress: true+permissions: {}+jobs:bump_version:runs-on: ubuntu-latest-outputs:ref: ${{ steps.push-tag.outputs.commit_long_sha }}-+ permissions: {} # No job-level permissions are needed because it uses the app-tokensteps:- name: Generate a tokenid: generate-token@@ -40,6 +41,7 @@ jobs:uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4with:token: ${{ steps.generate-token.outputs.token }}+ persist-credentials: true- name: Install uvuses: astral-sh/setup-uv@0c5e2b8115b80b4c7c5ddf6ffdd634974642d182 # v5@@ -59,14 +61,20 @@ jobs:build_mobile:uses: ./.github/workflows/build-mobile.ymlneeds: bump_version- secrets: inherit+ secrets:+ KEY_JKS: ${{ secrets.KEY_JKS }}+ ALIAS: ${{ secrets.ALIAS }}+ ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }}+ ANDROID_STORE_PASSWORD: ${{ secrets.ANDROID_STORE_PASSWORD }}with:ref: ${{ needs.bump_version.outputs.ref }}prepare_release:runs-on: ubuntu-latestneeds: build_mobile-+ permissions:+ actions: read # To download the app artifact+ # No content permissions are needed because it uses the app-tokensteps:- name: Generate a tokenid: generate-token@@ -79,6 +87,7 @@ jobs:uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4with:token: ${{ steps.generate-token.outputs.token }}+ persist-credentials: false- name: Download APKuses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4@@ -90,6 +99,7 @@ jobs:with:draft: truetag_name: ${{ env.IMMICH_VERSION }}+ token: ${{ steps.generate-token.outputs.token }}generate_release_notes: truebody_path: misc/release/notes.tmplfiles: |diff --git a/.github/workflows/preview-label.yaml b/.github/workflows/preview-label.yamlindex 447a309a2e..4c445f13d0 100644--- a/.github/workflows/preview-label.yaml+++ b/.github/workflows/preview-label.yaml@@ -4,6 +4,8 @@ on:pull_request:types: [labeled, closed]+permissions: {}+jobs:comment-status:runs-on: ubuntu-latestdiff --git a/.github/workflows/sdk.yml b/.github/workflows/sdk.ymlindex cde2075423..482faf29f4 100644--- a/.github/workflows/sdk.yml+++ b/.github/workflows/sdk.yml@@ -4,18 +4,22 @@ on:release:types: [published]-permissions:- packages: write+permissions: {}jobs:publish:name: Publish `@immich/sdk`runs-on: ubuntu-latest+ permissions:+ contents: readdefaults:run:working-directory: ./open-api/typescript-sdksteps:- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4+ with:+ persist-credentials: false+# Setup .npmrc file to publish to npm- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4with:diff --git a/.github/workflows/static_analysis.yml b/.github/workflows/static_analysis.ymlindex 615082f86a..1a3c11d3d5 100644--- a/.github/workflows/static_analysis.yml+++ b/.github/workflows/static_analysis.yml@@ -9,14 +9,20 @@ concurrency:group: ${{ github.workflow }}-${{ github.ref }}cancel-in-progress: true+permissions: {}+jobs:pre-job:runs-on: ubuntu-latest+ permissions:+ contents: readoutputs:should_run: ${{ steps.found_paths.outputs.mobile == 'true' || steps.should_force.outputs.should_force == 'true' }}steps:- name: Checkout codeuses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4+ with:+ persist-credentials: false- id: found_pathsuses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3with:@@ -33,12 +39,14 @@ jobs:name: Run Dart Code Analysisneeds: pre-jobif: ${{ needs.pre-job.outputs.should_run == 'true' }}-runs-on: ubuntu-latest-+ permissions:+ contents: readsteps:- name: Checkout codeuses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4+ with:+ persist-credentials: false- name: Setup Flutter SDKuses: subosito/flutter-action@e938fdf56512cc96ef2f93601a5a40bde3801046 # v2@@ -69,9 +77,11 @@ jobs:- name: Verify files have not changedif: steps.verify-changed-files.outputs.files_changed == 'true'+ env:+ CHANGED_FILES: ${{ steps.verify-changed-files.outputs.changed_files }}run: |echo "ERROR: Generated files not up to date! Run make_build inside the mobile directory"- echo "Changed files: ${{ steps.verify-changed-files.outputs.changed_files }}"+ echo "Changed files: ${CHANGED_FILES}"exit 1- name: Run dart analyzediff --git a/.github/workflows/test.yml b/.github/workflows/test.ymlindex f5cb6c8d30..91389c25ff 100644--- a/.github/workflows/test.yml+++ b/.github/workflows/test.yml@@ -9,9 +9,13 @@ concurrency:group: ${{ github.workflow }}-${{ github.ref }}cancel-in-progress: true+permissions: {}+jobs:pre-job:runs-on: ubuntu-latest+ permissions:+ contents: readoutputs:should_run_web: ${{ steps.found_paths.outputs.web == 'true' || steps.should_force.outputs.should_force == 'true' }}should_run_server: ${{ steps.found_paths.outputs.server == 'true' || steps.should_force.outputs.should_force == 'true' }}@@ -25,6 +29,9 @@ jobs:steps:- name: Checkout codeuses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4+ with:+ persist-credentials: false+- id: found_pathsuses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3with:@@ -58,6 +65,8 @@ jobs:needs: pre-jobif: ${{ needs.pre-job.outputs.should_run_server == 'true' }}runs-on: ubuntu-latest+ permissions:+ contents: readdefaults:run:working-directory: ./server@@ -65,6 +74,8 @@ jobs:steps:- name: Checkout codeuses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4+ with:+ persist-credentials: false- name: Setup Nodeuses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4@@ -95,6 +106,8 @@ jobs:needs: pre-jobif: ${{ needs.pre-job.outputs.should_run_cli == 'true' }}runs-on: ubuntu-latest+ permissions:+ contents: readdefaults:run:working-directory: ./cli@@ -102,6 +115,8 @@ jobs:steps:- name: Checkout codeuses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4+ with:+ persist-credentials: false- name: Setup Nodeuses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4@@ -136,6 +151,8 @@ jobs:needs: pre-jobif: ${{ needs.pre-job.outputs.should_run_cli == 'true' }}runs-on: windows-latest+ permissions:+ contents: readdefaults:run:working-directory: ./cli@@ -143,6 +160,8 @@ jobs:steps:- name: Checkout codeuses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4+ with:+ persist-credentials: false- name: Setup Nodeuses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4@@ -170,6 +189,8 @@ jobs:needs: pre-jobif: ${{ needs.pre-job.outputs.should_run_web == 'true' }}runs-on: ubuntu-latest+ permissions:+ contents: readdefaults:run:working-directory: ./web@@ -177,6 +198,8 @@ jobs:steps:- name: Checkout codeuses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4+ with:+ persist-credentials: false- name: Setup Nodeuses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4@@ -215,6 +238,8 @@ jobs:needs: pre-jobif: ${{ needs.pre-job.outputs.should_run_e2e == 'true' }}runs-on: ubuntu-latest+ permissions:+ contents: readdefaults:run:working-directory: ./e2e@@ -222,6 +247,8 @@ jobs:steps:- name: Checkout codeuses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4+ with:+ persist-credentials: false- name: Setup Nodeuses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4@@ -254,6 +281,8 @@ jobs:needs: pre-jobif: ${{ needs.pre-job.outputs.should_run_server == 'true' }}runs-on: ubuntu-latest+ permissions:+ contents: readdefaults:run:working-directory: ./server@@ -261,6 +290,8 @@ jobs:steps:- name: Checkout codeuses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4+ with:+ persist-credentials: false- name: Setup Nodeuses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4@@ -279,6 +310,8 @@ jobs:needs: pre-jobif: ${{ needs.pre-job.outputs.should_run_e2e_server_cli == 'true' }}runs-on: mich+ permissions:+ contents: readdefaults:run:working-directory: ./e2e@@ -287,6 +320,7 @@ jobs:- name: Checkout codeuses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4with:+ persist-credentials: falsesubmodules: 'recursive'- name: Setup Node@@ -321,6 +355,8 @@ jobs:needs: pre-jobif: ${{ needs.pre-job.outputs.should_run_e2e_web == 'true' }}runs-on: mich+ permissions:+ contents: readdefaults:run:working-directory: ./e2e@@ -329,6 +365,7 @@ jobs:- name: Checkout codeuses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4with:+ persist-credentials: falsesubmodules: 'recursive'- name: Setup Node@@ -362,8 +399,13 @@ jobs:needs: pre-jobif: ${{ needs.pre-job.outputs.should_run_mobile == 'true' }}runs-on: ubuntu-latest+ permissions:+ contents: readsteps:- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4+ with:+ persist-credentials: false+- name: Setup Flutter SDKuses: subosito/flutter-action@e938fdf56512cc96ef2f93601a5a40bde3801046 # v2with:@@ -378,11 +420,16 @@ jobs:needs: pre-jobif: ${{ needs.pre-job.outputs.should_run_ml == 'true' }}runs-on: ubuntu-latest+ permissions:+ contents: readdefaults:run:working-directory: ./machine-learningsteps:- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4+ with:+ persist-credentials: false+- name: Install uvuses: astral-sh/setup-uv@0c5e2b8115b80b4c7c5ddf6ffdd634974642d182 # v5- uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5@@ -411,6 +458,8 @@ jobs:needs: pre-jobif: ${{ needs.pre-job.outputs['should_run_.github'] == 'true' }}runs-on: ubuntu-latest+ permissions:+ contents: readdefaults:run:working-directory: ./.github@@ -418,6 +467,8 @@ jobs:steps:- name: Checkout codeuses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4+ with:+ persist-credentials: false- name: Setup Nodeuses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4@@ -434,22 +485,31 @@ jobs:shellcheck:name: ShellCheckruns-on: ubuntu-latest+ permissions:+ contents: readsteps:- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4+ with:+ persist-credentials: false+- name: Run ShellCheckuses: ludeeus/action-shellcheck@masterwith:ignore_paths: >-**/open-api/**- **/openapi/**+ **/openapi****/node_modules/**generated-api-up-to-date:name: OpenAPI Clientsruns-on: ubuntu-latest+ permissions:+ contents: readsteps:- name: Checkout codeuses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4+ with:+ persist-credentials: false- name: Setup Nodeuses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4@@ -476,14 +536,18 @@ jobs:- name: Verify files have not changedif: steps.verify-changed-files.outputs.files_changed == 'true'+ env:+ CHANGED_FILES: ${{ steps.verify-changed-files.outputs.changed_files }}run: |echo "ERROR: Generated files not up to date!"- echo "Changed files: ${{ steps.verify-changed-files.outputs.changed_files }}"+ echo "Changed files: ${CHANGED_FILES}"exit 1generated-typeorm-migrations-up-to-date:name: TypeORM Checksruns-on: ubuntu-latest+ permissions:+ contents: readservices:postgres:image: tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:739cdd626151ff1f796dc95a6591b55a714f341c737e27f045019ceabf8e8c52@@ -505,6 +569,8 @@ jobs:steps:- name: Checkout codeuses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4+ with:+ persist-credentials: false- name: Setup Nodeuses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4@@ -535,9 +601,11 @@ jobs:server/src- name: Verify migration files have not changedif: steps.verify-changed-files.outputs.files_changed == 'true'+ env:+ CHANGED_FILES: ${{ steps.verify-changed-files.outputs.changed_files }}run: |echo "ERROR: Generated migration files not up to date!"- echo "Changed files: ${{ steps.verify-changed-files.outputs.changed_files }}"+ echo "Changed files: ${CHANGED_FILES}"cat ./src/*-TestMigration.tsexit 1@@ -555,9 +623,11 @@ jobs:- name: Verify SQL files have not changedif: steps.verify-changed-sql-files.outputs.files_changed == 'true'+ env:+ CHANGED_FILES: ${{ steps.verify-changed-sql-files.outputs.changed_files }}run: |echo "ERROR: Generated SQL files not up to date!"- echo "Changed files: ${{ steps.verify-changed-sql-files.outputs.changed_files }}"+ echo "Changed files: ${CHANGED_FILES}"exit 1# mobile-integration-tests:diff --git a/.github/workflows/weblate-lock.yml b/.github/workflows/weblate-lock.ymlindex 69dce3ac41..2aef5c472a 100644--- a/.github/workflows/weblate-lock.yml+++ b/.github/workflows/weblate-lock.yml@@ -4,30 +4,32 @@ on:pull_request:branches: [main]+permissions: {}+jobs:pre-job:runs-on: ubuntu-latest+ permissions:+ contents: readoutputs:should_run: ${{ steps.found_paths.outputs.i18n == 'true' && github.head_ref != 'chore/translations'}}steps:- name: Checkout codeuses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4+ with:+ persist-credentials: false- id: found_pathsuses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3with:filters: |i18n:- 'i18n/!(en)**\.json'- - name: Debug- run: |- echo "Should run: ${{ steps.found_paths.outputs.i18n == 'true' && github.head_ref != 'chore/translations'}}"- echo "Found i18n paths: ${{ steps.found_paths.outputs.i18n }}"- echo "Head ref: ${{ github.head_ref }}"enforce-lock:name: Check Weblate Lockneeds: [pre-job]runs-on: ubuntu-latest+ permissions: {}if: ${{ needs.pre-job.outputs.should_run == 'true' }}steps:- name: Check weblate lock@@ -47,6 +49,7 @@ jobs:name: Weblate Lock Check Successneeds: [enforce-lock]runs-on: ubuntu-latest+ permissions: {}if: always()steps:- name: Any jobs failed?