mirror of
https://github.com/github/codeql-action.git
synced 2026-01-05 22:20:20 +08:00
This runs checks on reopened draft PRs to support triggering PR checks on draft PRs that were opened by other workflows.
40 lines
1.2 KiB
YAML
40 lines
1.2 KiB
YAML
name: Update dependencies
|
|
on:
|
|
pull_request_target:
|
|
types: [opened, synchronize, reopened, ready_for_review, labeled]
|
|
|
|
jobs:
|
|
update:
|
|
name: Update dependencies
|
|
runs-on: macos-latest
|
|
if: contains(github.event.pull_request.labels.*.name, 'Update dependencies')
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Remove PR label
|
|
env:
|
|
REPOSITORY: '${{ github.repository }}'
|
|
PR_NUMBER: '${{ github.event.pull_request.number }}'
|
|
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
|
|
run: |
|
|
gh api "repos/$REPOSITORY/issues/$PR_NUMBER/labels/Update%20dependencies" -X DELETE
|
|
|
|
- name: Push updated dependencies
|
|
env:
|
|
BRANCH: '${{ github.head_ref }}'
|
|
run: |
|
|
git fetch
|
|
git checkout $BRANCH
|
|
sudo npm install --force -g npm@latest
|
|
npm install
|
|
npm ci
|
|
npm run removeNPMAbsolutePaths
|
|
if [ ! -z "$(git status --porcelain)" ]; then
|
|
git config --global user.email "github-actions@github.com"
|
|
git config --global user.name "github-actions[bot]"
|
|
git add node_modules
|
|
git commit -am "Update checked-in dependencies"
|
|
git push origin "$BRANCH"
|
|
fi
|