From a56c000f602424c21d79d9b80495889333baa1c1 Mon Sep 17 00:00:00 2001 From: Otto Richter Date: Sun, 15 Sep 2024 02:08:36 +0200 Subject: [PATCH] Replace setup-go with a custom action To maximize the caching efficiency, all build jobs are executed as forgejo user. Hash is explicitly specified to avoid breaking changes. --- .forgejo/workflows/composite/setup-env/action.yaml | 6 +++--- .forgejo/workflows/testing.yml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.forgejo/workflows/composite/setup-env/action.yaml b/.forgejo/workflows/composite/setup-env/action.yaml index 30e78dbb71..65ffa8341c 100644 --- a/.forgejo/workflows/composite/setup-env/action.yaml +++ b/.forgejo/workflows/composite/setup-env/action.yaml @@ -1,11 +1,11 @@ runs: using: "composite" steps: - - uses: https://code.forgejo.org/actions/setup-go@v4 - with: - go-version-file: "go.mod" - name: setup user and permissions run: | git config --add safe.directory '*' adduser --quiet --comment forgejo --disabled-password forgejo chown -R forgejo:forgejo . + - uses: https://codeberg.org/fnetx/setup-cache-go@b2214eaf6fb44c7e8512c0f462a2c3ec31f86a73 + with: + username: forgejo diff --git a/.forgejo/workflows/testing.yml b/.forgejo/workflows/testing.yml index 8c1e6d06f8..943c3a3c8b 100644 --- a/.forgejo/workflows/testing.yml +++ b/.forgejo/workflows/testing.yml @@ -214,5 +214,5 @@ jobs: steps: - uses: https://code.forgejo.org/actions/checkout@v3 - uses: ./.forgejo/workflows/composite/setup-env - - run: make deps-backend deps-tools - - run: make security-check + - run: su forgejo -c 'make deps-backend deps-tools' + - run: su forgejo -c 'make security-check'