This repository has been archived by the owner on Nov 30, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
59 lines (50 loc) · 1.77 KB
/
patch.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
name: Run Patches
on:
workflow_dispatch:
push:
branches: [main]
paths:
- 'build/patch/**'
jobs:
patch-all:
name: Run Patches
if: "!contains(github.event.head_commit.message, 'Automated update') && !contains(github.event.head_commit.message, 'CI ignore')"
runs-on: ubuntu-latest
steps:
- name: Free more space
id: free_space
run: |
set -e
# Ensure enough space is available for build
sudo apt-get autoremove -y
sudo apt-get clean -y
sudo rm -rf /usr/share/dotnet
- name: Checkout
id: checkout
uses: actions/checkout@v1
- name: Azure CLI login
id: az_login
uses: azure/login@v1
with:
creds: ${{ secrets.AZ_ACR_CREDS }}
- name: Run patches
id: run_all_patches
run: |
set -e
# ACR login
ACR_REGISTRY_NAME=$(echo ${{ secrets.REGISTRY }} | grep -oP '(.+)(?=\.azurecr\.io)')
az acr login --name $ACR_REGISTRY_NAME
# Execute patching
yarn install
build/vscdc patch --all \
--registry ${{ secrets.REGISTRY }} \
--registry-path ${{ secrets.REGISTRY_BASE_PATH }}
# Add resulting status.json file back to source control
git config --global user.email "[email protected]"
git config --global user.name "CI"
git config pull.rebase false
git pull "https://ci:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}" "HEAD:${{ github.ref }}"
git add build/patch/status.json
git commit -m 'Automated update' \
&& git push "https://ci:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}" "HEAD:${{ github.ref }}" \
|| echo 'No updates to status.json'