chore: use git token
This commit is contained in:
parent
79885f579c
commit
6f5c3d3c78
@ -24,8 +24,8 @@ steps:
|
||||
- mkdir /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=CI_REPO_CLONE_URL,CI_COMMIT_BRANCH,CI_PREV_COMMIT_SHA,GIT_PASSWORD sh -c './build.sh'
|
||||
secrets: [pgp_id, pgp_key, pgp_pwd, git_password]
|
||||
- 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_user, git_token]
|
||||
when:
|
||||
branch: master
|
||||
event: [push, cron, tag, manual]
|
||||
|
2
build.sh
2
build.sh
@ -45,7 +45,7 @@ git config --global user.name "drone"
|
||||
git config --global init.defaultBranch master
|
||||
git remote set-url origin "${CI_REPO_CLONE_URL}"
|
||||
# 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
|
||||
cd "${d}" || continue
|
||||
|
Loading…
Reference in New Issue
Block a user