-
Notifications
You must be signed in to change notification settings - Fork 129
58 lines (53 loc) · 1.65 KB
/
update-package-lock.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: Update package-lock.json
on:
schedule:
# This is probably 6am UTC, which is 10pm PST or 11pm PDT
# Alternatively, 6am local is also fine
- cron: '0 6 * * *'
workflow_dispatch: {}
jobs:
updatePackageJsonLock:
runs-on: ubuntu-latest
if: github.repository == 'microsoft/TypeScript-TmLanguage'
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Configure git and update package-lock.json
run: |
git config user.email "typescriptbot@microsoft.com"
git config user.name "TypeScript Bot"
rm package-lock.json
npm install --package-lock-only --ignore-scripts # This is a no-op if package-lock.json is present.
git add -f package-lock.json
if git commit -m "Update package-lock.json"; then
git push
fi
tests:
runs-on: ubuntu-latest
needs: [updatePackageJsonLock]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm i
- run: npm test
createIssue:
runs-on: ubuntu-latest
if: ${{ failure() }}
needs: [updatePackageJsonLock, tests]
permissions:
contents: read # Apparently required to create issues
issues: write
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAGS: "@sheetalkamat"
steps:
- uses: actions/checkout@v4
- run: |
HASH=$(git log -1 --format=%h)
gh issue create --repo ${{ github.repository }} --title "package-lock.json update failed" --body "$TAGS Please check the errors after run on $HASH"