-
Notifications
You must be signed in to change notification settings - Fork 420
Enable dependabot automatic updates #630
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| version: 2 | ||
| updates: | ||
| - package-ecosystem: "npm" | ||
| directory: "/" | ||
| schedule: | ||
| interval: "weekly" | ||
| day: "thursday" # Gives us a working day to merge this before our typical release | ||
| labels: | ||
| - "Update dependencies" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| name: Update dependencies | ||
| on: | ||
| pull_request_target: | ||
| types: [opened, synchronize, reopened, 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 | ||
robertbrignull marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| 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 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm surprised this works. I thought you'd have to add
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This works and was previously necessary when I had just |
||
| sudo npm install --force -g npm@latest | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just an open question of is using latest better than using what's on the actions VMs. They come with something pretty modern anyway, and it may be more stable than going with the latest. Although I assume this is still the latest released version and not true bleeding edge, so it's probably fine either way. Whatever we do here, it should match the NPM version used in https://github.com/github/codeql-action/blob/main/.github/workflows/pr-checks.yml
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was actually unfortunately necessary because the version in the Actions VM is old enough that it uses v1 of the lockfile and cannot do |
||
| 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 | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.