From bfdf73caeb104f4e62add065bc91789ad336e480 Mon Sep 17 00:00:00 2001 From: naskya Date: Mon, 6 May 2024 18:38:54 +0900 Subject: [PATCH] ci: fix permisson --- .gitlab-ci.yml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5f36b13110..de1e0317eb 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -45,10 +45,9 @@ auto_update: - apk add git - git config user.name 'GitLab CI' - git config user.email 'noreply@firefish.dev' - - git remote set-url origin "https://gitlab-ci-token:${CI_JOB_TOKEN}@firefish.dev/${CI_MERGE_REQUEST_SOURCE_PROJECT_PATH}" - - git fetch origin - - git switch "${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}" - - git pull --ff + - git remote add mr_origin "https://gitlab-ci-token:${CI_JOB_TOKEN}@firefish.dev/${CI_MERGE_REQUEST_SOURCE_PROJECT_PATH}" + - git fetch mr_origin + - git checkout -b "${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}" FETCH_HEAD # update pnpm lockfile - pnpm install # commit @@ -56,7 +55,7 @@ auto_update: if [ `git status -s | wc -l` -gt 0 ]; then git add . git commit --message 'chore: update lockfile' - git push --push-option=ci.skip origin "${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}" + git push --push-option=ci.skip "https://gitlab-ci-token:${CI_JOB_TOKEN}@firefish.dev/${CI_MERGE_REQUEST_SOURCE_PROJECT_PATH}" "${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}" fi # run format - pnpm run format @@ -65,7 +64,7 @@ auto_update: if [ `git status -s | wc -l` -gt 0 ]; then git add . git commit --message 'chore: format' - git push --push-option=ci.skip origin "${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}" + git push --push-option=ci.skip "https://gitlab-ci-token:${CI_JOB_TOKEN}@firefish.dev/${CI_MERGE_REQUEST_SOURCE_PROJECT_PATH}" "${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}" fi # update packages/backend-rs/src/model/entity - apk install pkgconfig openssl openssl-dev libssl3 @@ -98,7 +97,7 @@ auto_update: if [ `git status -s | wc -l` -gt 0 ]; then git add . git commit --message 'chore (backend-rs): regenerate entity' - git push --push-option=ci.skip origin "${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}" + git push --push-option=ci.skip "https://gitlab-ci-token:${CI_JOB_TOKEN}@firefish.dev/${CI_MERGE_REQUEST_SOURCE_PROJECT_PATH}" "${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}" fi # update packages/backend-rs/index.{js,d.ts} - pnpm run build:debug @@ -109,5 +108,5 @@ auto_update: if [ `git status -s | wc -l` -gt 0 ]; then git add . git commit --message 'chore (backend-rs): regenerate index' - git push --push-option=ci.skip origin "${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}" + git push --push-option=ci.skip "https://gitlab-ci-token:${CI_JOB_TOKEN}@firefish.dev/${CI_MERGE_REQUEST_SOURCE_PROJECT_PATH}" "${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}" fi