Skip to content

Commit 0ebee75

Browse files
Merge pull request #789 from edoardopirovano/secure-workflow
Improve workflow to update dependencies
2 parents bee5aac + 70f007a commit 0ebee75

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

.github/workflows/update-dependencies.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
update:
88
name: Update dependencies
99
runs-on: macos-latest
10-
if: contains(github.event.pull_request.labels.*.name, 'Update dependencies')
10+
if: contains(github.event.pull_request.labels.*.name, 'Update dependencies') && ${{ github.event.pull_request.head.repo.full_name == 'github/codeql-action' }}
1111
steps:
1212
- name: Checkout repository
1313
uses: actions/checkout@v2
@@ -24,8 +24,8 @@ jobs:
2424
env:
2525
BRANCH: '${{ github.head_ref }}'
2626
run: |
27-
git fetch
28-
git checkout $BRANCH
27+
git fetch origin "$BRANCH" --depth=1
28+
git checkout "origin/$BRANCH"
2929
sudo npm install --force -g npm@latest
3030
npm install
3131
npm ci

0 commit comments

Comments
 (0)