-
-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (70 loc) · 2.44 KB
/
update-vscode.yml
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: ' 🗳️ Update VS Code Types'
on:
push:
branches:
- main
workflow_dispatch:
inputs:
base:
description: The Base Ref to apply the diff
required: false
default: 'main'
schedule:
- cron: '0 12 * * *'
permissions:
contents: read
jobs:
update-vscode-types:
if: github.repository_owner == 'streetsidesoftware'
runs-on: ubuntu-latest
env:
NEW_BRANCH: update-vscode-types-${{ inputs.base || 'main' }}
REF_BRANCH: ${{ inputs.base || 'main' }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ env.REF_BRANCH }}
- name: Corepack Enable
run: corepack enable
- name: Use Node.js
uses: actions/setup-node@v4
with:
cache: 'pnpm'
- name: Install
run: pnpm install
- name: Capture current VSCode Version
run: |
echo "VSCODE_VERSION_OLD=$(jq -r ".devDependencies[\"@types/vscode\"]" package.json )" >> $GITHUB_ENV
- name: Update
run: |
pnpm run update-vscode
echo "VSCODE_VERSION=$(jq -r ".devDependencies[\"@types/vscode\"]" package.json )" >> $GITHUB_ENV
- name: Check VSCode Version Changed
id: vscode_changed
uses: streetsidesoftware/actions/public/output@v1
with:
value: ${{ env.VSCODE_VERSION != env.VSCODE_VERSION_OLD }}
- name: Gen Body
id: gen_body
uses: streetsidesoftware/actions/public/output@v1
with:
value: |
# Update VS Code Types
CSpell Version: **`${{ env.VSCODE_VERSION_OLD }}`** --> **`${{ env.VSCODE_VERSION }}`**
Changed: **${{ steps.vscode_changed.outputs.value }}**
- name: Create Pull Request
if: steps.vscode_changed.outputs.value == 'true'
uses: streetsidesoftware/actions/.github/actions/pr@v1
with:
commit-message: 'fix: Update VSCode to (${{ env.VSCODE_VERSION }})'
branch: ${{ env.NEW_BRANCH }}
base: ${{ env.REF_BRANCH }}
title: 'fix: Update VSCode to (${{ env.VSCODE_VERSION }}) (${{ env.REF_BRANCH }})'
body: ${{ steps.gen_body.outputs.value }}
app_id: ${{ secrets.AUTOMATION_APP_ID }}
app_private_key: ${{ secrets.AUTOMATION_PRIVATE_KEY }}
- name: Summary
uses: streetsidesoftware/actions/public/summary@v1
with:
text: ${{ steps.gen_body.outputs.value }}