-
Notifications
You must be signed in to change notification settings - Fork 30
75 lines (66 loc) · 1.81 KB
/
updateVersions.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
name: Update Versions
on:
schedule:
- cron: "*/30 * * * *"
jobs:
build:
runs-on: ubuntu-20.04
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v2-beta
with:
node-version: '14'
- name: Install NPM dependencies
run: npm ci
- name: Fetch versions
run: npm run fetchVersions
- name: Branch protection OFF
uses: octokit/[email protected]
with:
route: PUT /repos/:repository/branches/master/protection
repository: ${{ github.repository }}
required_status_checks: |
null
enforce_admins: |
null
required_pull_request_reviews: |
null
restrictions: |
null
env:
GITHUB_TOKEN: ${{ secrets.GH_ACTIONS_REPO_ADMIN_CI_TOKEN }}
- name: Commit changes
run: |
if [[ -n $(git status -s) ]]
then
git config --global user.name 'UI5.Bot'
git config --global user.email '[email protected]'
git commit -am "Automatic versions update"
git push
else
echo "NO CHANGES! SKIPPING COMMIT & PUSH!"
fi
- name: Branch protection ON
uses: octokit/[email protected]
with:
route: PUT /repos/:repository/branches/master/protection
repository: ${{ github.repository }}
required_status_checks: |
strict: true
contexts:
- Travis CI - Pull Request
- license/cla
enforce_admins: |
null
required_pull_request_reviews: |
null
restrictions: |
null
allow_force_pushes: |
true
required_linear_history: |
true
env:
GITHUB_TOKEN: ${{ secrets.GH_ACTIONS_REPO_ADMIN_CI_TOKEN }}