fix: authentication in actions

This commit is contained in:
Cheng Liu 2024-03-11 15:31:04 -07:00
parent c01f10e561
commit e6f85b42e6
No known key found for this signature in database
GPG key ID: EEC8452F7DB85CD6
2 changed files with 7 additions and 2 deletions

View file

@ -33,11 +33,13 @@ jobs:
uses: actions/checkout@v3
with:
fetch-depth: 2
token: ${{ secrets.BOT_ACCESS_TOKEN }}
- name: Configure Git
env:
GITHUB_TOKEN: ${{ secrets.BOT_ACCESS_TOKEN }}
run: |
git config --local user.name tiktokbot
git config --local user.email tiktokbot@users.noreply.github.com
git config --global credential.helper '!f() { echo "protocol=https\nhost=github.com" ; echo "username=oauth_token" ; echo "password=${GITHUB_TOKEN}" ; }; f'
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}

View file

@ -20,7 +20,10 @@ export async function runAsync(runScriptOptions: IRunScriptOptions): Promise<voi
} = runScriptOptions;
const temporaryDirectory: string = path.resolve(buildFolderPath, 'temp');
const testRepoURL: string = 'git@github.com:tiktok/sparo.git';
let testRepoURL: string = 'git@github.com:tiktok/sparo.git';
if (production) {
testRepoURL = 'https://github.com/tiktok/sparo.git';
}
const repoFolder: string = path.resolve(temporaryDirectory, 'sparo');
await FileSystem.deleteFolderAsync(repoFolder);