Skip to content

Update Attribute Dictionary JSON #248

Update Attribute Dictionary JSON

Update Attribute Dictionary JSON #248

name: Update Attribute Dictionary JSON
on:
workflow_dispatch:
schedule:
# 12pm UTC every day (5a PDT)
- cron: '0 12 * * *'
env:
API_KEY: ${{ secrets.NEW_RELIC_API_KEY }}
BOT_NAME: nr-opensource-bot
BOT_EMAIL: [email protected]
jobs:
update-json:
name: Update JSON
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 16
- name: Get current date
id: date
run: echo "date:=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Fetch Attribute Dictionary Data
id: fetch-attribute-dictionary
run: yarn update-attribute-dictionary-json
- name: Commit changes
id: commit-changes
if: steps.fetch-attribute-dictionary.outputs.updateAttributeDictionary != 'false'
run: |
git config --local user.email "${{ env.BOT_EMAIL }}"
git config --local user.name "${{ env.BOT_NAME }}"
git add src/data/attribute-dictionary.json
git commit -m 'chore: Update Attribute Dictionary JSON'
- name: Create Pull Request
id: create-pr
if: steps.fetch-attribute-dictionary.outputs.updateAttributeDictionary != 'false'
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.DEVEX_OPENSOURCE_BOT_TOKEN }}
title: Update Attribute Dictionary JSON - ${{ steps.date.outputs.date }}
branch: update-attribute-dictionary-json
branch-suffix: short-commit-hash
body: ''
base: develop
delete-branch: true
team-reviewers: docs-engineering