-
Notifications
You must be signed in to change notification settings - Fork 1.7k
40 lines (38 loc) · 1.67 KB
/
sync-develop-from-smartcontractkit-chainlink.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
name: Sync develop from smartcontractkit/chainlink
on:
schedule:
# * is a special character in YAML so you have to quote this string
- cron: '*/30 * * * *'
jobs:
sync:
name: Sync
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
with:
ref: develop
if: env.GITHUB_REPOSITORY != 'smartcontractkit/chainlink'
- name: Sync
run: |
git remote add upstream "https://github.com/smartcontractkit/chainlink.git"
COMMIT_HASH_UPSTREAM=$(git ls-remote upstream develop | grep -P '^[0-9a-f]{40}\trefs/heads/develop$' | cut -f 1)
COMMIT_HASH_ORIGIN=$(git ls-remote origin develop | grep -P '^[0-9a-f]{40}\trefs/heads/develop$' | cut -f 1)
if [ "$COMMIT_HASH_UPSTREAM" = "$COMMIT_HASH_ORIGIN" ]; then
echo "Both remotes have develop at $COMMIT_HASH_UPSTREAM. No need to sync."
else
echo "upstream has develop at $COMMIT_HASH_UPSTREAM. origin has develop at $COMMIT_HASH_ORIGIN. Syncing..."
git fetch upstream
git push origin upstream/develop:develop
fi
if: env.GITHUB_REPOSITORY != 'smartcontractkit/chainlink'
- name: Collect Metrics
if: always()
id: collect-gha-metrics
uses: smartcontractkit/push-gha-metrics-action@dea9b546553cb4ca936607c2267a09c004e4ab3f # v3.0.0
with:
id: sync-develop
org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }}
basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }}
hostname: ${{ secrets.GRAFANA_INTERNAL_HOST }}
this-job-name: Sync
continue-on-error: true