Skip to content

Check if chainlink automation config is up to date #193

Check if chainlink automation config is up to date

Check if chainlink automation config is up to date #193

name: Check if chainlink automation config is up to date
on:
schedule:
- cron: '59 23 * * */7'
workflow_dispatch:
jobs:
check-chainlink-automation-config:
permissions:
pull-requests: write
contents: write
name: Check if chainlinnk automation config is up to date
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./
steps:
- name: Checkout Repo
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- name: Install Dependencies
run: npm i
- name: Compare current config with the deployed one
run: npm run sync-chainlink-automation-config
- name: Check if new config file
id: compare_configs
run: |
set -x
if test -f "./src/features/chainlink-automation/data/chainlink-automation-configTOBE.json"; then
cp "./src/features/chainlink-automation/data/chainlink-automation-configTOBE.json" "./src/features/chainlink-automation/data/chainlink-automation-config.json"
echo "{createPR}={true}" >> $GITHUB_OUTPUT
timestamp=$(date +%Y%m%d%H%M)
echo "{timestamp}={${timestamp}}" >> $GITHUB_OUTPUT
fi
- if: ${{ steps.compare_configs.outputs.createPR }}
id: chainlink_automation_config_pr
name: Create pull request
uses: peter-evans/create-pull-request@6d6857d36972b65feb161a90e484f2984215f83e # v6.0.5
with:
branch: 'chainlink_automation_config/pr-${{ steps.compare_configs.outputs.timestamp }}'
commit-message: 'chainlink automation config updated'
token: ${{ secrets.GITHUB_TOKEN }}
title: 'Update chainlink automation config ${{ steps.compare_configs.outputs.timestamp }}'
delete-branch: true
body: 'New chainlink automation config available. Please review and merge'
labels: |
enhancement
ready to merge