forked from owini/New-Grad-Positions
-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (51 loc) · 1.55 KB
/
update.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
name: Update
on:
push:
branches:
- dev
schedule:
- cron: '0 */6 * * *'
workflow_dispatch:
jobs:
update:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.9"
- name: Add Git Commiter Details
run: |
git config --global user.email "sharunksplus@gmail.com"
git config --global user.name "Sharun"
- name: Upstream Setup & Merge
run: |
git remote add upstream https://github.com/SimplifyJobs/New-Grad-Positions.git
git fetch upstream
git merge --log upstream/dev --strategy=recursive --strategy-option=ours
# This has to be done first due to permissions reasons
- name: Move other workflows
run: |
find .github/workflows/ -name '*.yml' ! -name 'update.yml' -exec git mv {} .github/archived-workflows/ \;
- name: Commit
run: |
if [[ `git status --porcelain` ]]; then
git commit -am "move unused workflows"
else
echo "No changes to commit"
fi
- name: Update README & Commit
run: |
cp .github/template/README.md .
python .github/scripts/update_readmes.py
if [[ `git status --porcelain` ]]; then
git commit --quiet --all --amend --no-edit
else
echo "No changes to commit"
fi
- name: Push
run: git push