Skip to content

Sync develop from smartcontractkit/chainlink #56067

Sync develop from smartcontractkit/chainlink

Sync develop from smartcontractkit/chainlink #56067

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@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
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@d2c2b7bdc9012651230b2608a1bcb0c48538b6ec
with:
basic-auth: ${{ secrets.GRAFANA_CLOUD_BASIC_AUTH }}
hostname: ${{ secrets.GRAFANA_CLOUD_HOST }}
this-job-name: Sync
continue-on-error: true