forked from newrelic/docs-website
-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (50 loc) · 1.78 KB
/
update-attribute-dictionary-json.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
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: svc-docs-eng-opensource-bot@newrelic.com
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