From 70f007a73c1fdf6e1919205a1236165d30eb9793 Mon Sep 17 00:00:00 2001 From: Edoardo Pirovano Date: Fri, 22 Oct 2021 10:43:31 +0100 Subject: [PATCH] Improve workflow to update dependencies --- .github/workflows/update-dependencies.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/update-dependencies.yml b/.github/workflows/update-dependencies.yml index 51ac91867..61d387d03 100644 --- a/.github/workflows/update-dependencies.yml +++ b/.github/workflows/update-dependencies.yml @@ -7,7 +7,7 @@ jobs: update: name: Update dependencies runs-on: macos-latest - if: contains(github.event.pull_request.labels.*.name, 'Update dependencies') + if: contains(github.event.pull_request.labels.*.name, 'Update dependencies') && ${{ github.event.pull_request.head.repo.full_name == 'github/codeql-action' }} steps: - name: Checkout repository uses: actions/checkout@v2 @@ -24,8 +24,8 @@ jobs: env: BRANCH: '${{ github.head_ref }}' run: | - git fetch - git checkout $BRANCH + git fetch origin "$BRANCH" --depth=1 + git checkout "origin/$BRANCH" sudo npm install --force -g npm@latest npm install npm ci