chore: use git token

This commit is contained in:
nyyu 2024-07-15 07:26:30 +02:00
parent 79885f579c
commit 6f5c3d3c78
2 changed files with 3 additions and 3 deletions

View File

@ -24,8 +24,8 @@ steps:
- mkdir /build - mkdir /build
- chown -R build:build . /build - chown -R build:build . /build
- sudo -u build --preserve-env=PGP_KEY,PGP_PWD,PGP_ID sh -c 'mkdir ~/.gnupg && echo -e "default-cache-ttl 3600\nallow-preset-passphrase" > ~/.gnupg/gpg-agent.conf && echo "$PGP_KEY" | gpg --import --no-tty --batch --yes && echo "$PGP_PWD" | /usr/lib/gnupg/gpg-preset-passphrase --preset $PGP_ID' - sudo -u build --preserve-env=PGP_KEY,PGP_PWD,PGP_ID sh -c 'mkdir ~/.gnupg && echo -e "default-cache-ttl 3600\nallow-preset-passphrase" > ~/.gnupg/gpg-agent.conf && echo "$PGP_KEY" | gpg --import --no-tty --batch --yes && echo "$PGP_PWD" | /usr/lib/gnupg/gpg-preset-passphrase --preset $PGP_ID'
- sudo -u build --preserve-env=CI_REPO_CLONE_URL,CI_COMMIT_BRANCH,CI_PREV_COMMIT_SHA,GIT_PASSWORD sh -c './build.sh' - sudo -u build --preserve-env=CI_REPO_CLONE_URL,CI_COMMIT_BRANCH,CI_PREV_COMMIT_SHA,GIT_USER,GIT_TOKEN sh -c './build.sh'
secrets: [pgp_id, pgp_key, pgp_pwd, git_password] secrets: [pgp_id, pgp_key, pgp_pwd, git_user, git_token]
when: when:
branch: master branch: master
event: [push, cron, tag, manual] event: [push, cron, tag, manual]

View File

@ -45,7 +45,7 @@ git config --global user.name "drone"
git config --global init.defaultBranch master git config --global init.defaultBranch master
git remote set-url origin "${CI_REPO_CLONE_URL}" git remote set-url origin "${CI_REPO_CLONE_URL}"
# shellcheck disable=SC2016 # shellcheck disable=SC2016
git config credential.helper '!f() { sleep 1; echo "username=drone"; echo "password=${GIT_PASSWORD}"; }; f' git config credential.helper '!f() { sleep 1; echo "username=${GIT_USER}"; echo "password=${GIT_TOKEN}"; }; f'
for d in */; do for d in */; do
cd "${d}" || continue cd "${d}" || continue