-
Notifications
You must be signed in to change notification settings - Fork 12
47 lines (43 loc) · 1.39 KB
/
fetch-upstream.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
#
# fetch-upstream..yml
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# Github action to push the latest upstream changes to our repo.
#
# Every day at midnight, run this.
name: Fetch Upstream
on:
schedule:
- cron: "0 0 * * *"
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
Refresh-Upstream:
name: update_upstream_branches
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
#ref: master
- name: Set repo name
run: echo "UPSTREAM_PROJECT_NAME=lustre-release" >> $GITHUB_ENV
- name: Set repo URL
run: echo "LUSTRE_UPSTREAM_URL=git://git.whamcloud.com/fs/$UPSTREAM_PROJECT_NAME.git" >> $GITHUB_ENV
- run: |
echo "Fetching branches and tags from $LUSTRE_UPSTREAM_URL"
#cd $UPSTREAM_PROJECT_NAME
git remote add upstream $LUSTRE_UPSTREAM_URL
git fetch upstream
git fetch --tags upstream
name: "Fetch the latest changes and tags from upstream"
- run: |
git push origin --tags
for b in $(ls .git/refs/remotes/upstream); do
echo "Pushing updates to branch $b"
git push -f origin upstream/${b}:refs/heads/upstream/${b};
done
name: "Push tags and changes from the upstream branches"