-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (50 loc) · 1.91 KB
/
Copy pathupdate-tech-options.yml
File metadata and controls
62 lines (50 loc) · 1.91 KB
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
name: update-tech-options
run-name: Updating tech options according to the latest github templates
on:
workflow_dispatch:
schedule:
- cron: '0 3 * * 1'
jobs:
update-tech-options:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20.x'
- name: Delete branch
run: |
git push origin --delete update-tech-options
continue-on-error: true
- name: Recreate branch
run: |
git checkout -b update-tech-options
- name: Clone toptal templates
run: |
yarn clone-templates
- name: Run the prebuild script
run: yarn update-tech-options
- name: Check for changes
id: git-check
run: |
git diff --quiet || echo "::set-output name=has_changes::true"
- name: Commit changes
if: steps.git-check.outputs.has_changes == 'true'
run: |
git config --global user.name "FilipLunski"
git config --global user.email "filip.lunski@profiq.com"
git add -A
git commit -m "Update tech options $(date +%Y-%m-%d_%H:%M:%S)"
git push origin update-tech-options
- name: Create Pull Request
if: steps.git-check.outputs.has_changes == 'true'
env:
GH_TOKEN: ${{ github.token }}
run: |
gh pr create --title "Update tech options $(date +%Y-%m-%d_%H:%M:%S)" --body "Automatic update of tech options using github actions" --base main --head update-tech-options
- name: Create Empty Pull Request
if: steps.git-check.outputs.has_changes == 'false'
env:
GH_TOKEN: ${{ github.token }}
run: |
gh pr create --title "Tech options without change $(date +%Y-%m-%d_%H:%M:%S)" --body "Automatic update of tech options using github actions, nothing changed" --base main --head update-tech-options