From 85f1d137e38f472dfb73bf5e82c26cf28b394df2 Mon Sep 17 00:00:00 2001 From: Fuma Nama Date: Sat, 6 Jan 2024 18:44:50 +0800 Subject: [PATCH] Github Actions: Fix permission issues --- .github/workflows/lint.yml | 5 ----- .github/workflows/release.yml | 4 ++-- packages/create-next-docs/scripts/update-git-repo.sh | 10 ---------- 3 files changed, 2 insertions(+), 17 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 8cc3b86e3..037f62f6d 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -9,11 +9,6 @@ jobs: runs-on: ubuntu-latest steps: - - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action@0.12.0 - with: - access_token: ${{ github.token }} - - uses: actions/checkout@v4 - uses: pnpm/action-setup@v2.4.0 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 527823afb..fcfd65dca 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,6 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + token: ${{ secrets.UPDATE_TEMPLATE_SSH_KEY }} - uses: pnpm/action-setup@v2.4.0 with: @@ -34,6 +35,5 @@ jobs: publish: pnpm run release version: pnpm run version env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.UPDATE_TEMPLATE_SSH_KEY }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - UPDATE_TEMPLATE_SSH_KEY: ${{ secrets.UPDATE_TEMPLATE_SSH_KEY }} diff --git a/packages/create-next-docs/scripts/update-git-repo.sh b/packages/create-next-docs/scripts/update-git-repo.sh index 951ccac3d..c507c80d6 100644 --- a/packages/create-next-docs/scripts/update-git-repo.sh +++ b/packages/create-next-docs/scripts/update-git-repo.sh @@ -9,11 +9,6 @@ get_abs_filename() { DIR=$(get_abs_filename $(dirname "$0")) TMP=$(get_abs_filename "$DIR/../node_modules/.tmp") -if [ "$CI" ]; then - (umask 0077; echo "$UPDATE_TEMPLATE_SSH_KEY" > ~/ssh_key;) - export GIT_SSH_COMMAND='ssh -o StrictHostKeyChecking=accept-new -i ~/ssh_key' -fi - mkdir -p $TMP cd $TMP @@ -25,11 +20,6 @@ git clone --depth 1 --single-branch --branch main https://github.com/fuma-nama/n cd next-docs-ui-template node $DIR/update-git-repo.js $TMP/next-docs-ui-template -if [ "$CI" ]; then - git config user.email 'noreply@fuma.dev' - git config user.name '[bot]' -fi - # commit the new files git add -A git commit -m "version $npm_package_version"