Update Attribute Dictionary JSON #15
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update Attribute Dictionary JSON | |
on: | |
workflow_dispatch: | |
schedule: | |
# 12pm UTC (5a PDT) Monday - Friday | |
- cron: '0 12 * * 1-5' | |
env: | |
API_KEY: ${{ secrets.NEW_RELIC_API_KEY }} | |
BOT_NAME: svc-docs-eng-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: 22.4 | |
- 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.DOCS_ENG_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-ENG |