-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(automation): attempt to pass tutone config to generate workflow
- Loading branch information
1 parent
40dbd47
commit c70d0bb
Showing
4 changed files
with
123 additions
and
127 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,7 @@ jobs: | |
name: Check for API updates | ||
runs-on: ubuntu-latest | ||
outputs: | ||
apiEndpoints: ${{ steps.schema-diff.outputs.new_api_mutations }} | ||
apiEndpoints: ${{ steps.schema-diff.outputs.tutone_config }} | ||
steps: | ||
- name: Install Node | ||
uses: actions/setup-node@v4 | ||
|
@@ -29,7 +29,7 @@ jobs: | |
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Check for schema updates | ||
- name: Install deps | ||
run: ls scripts && npm install yaml | ||
|
||
- name: Download artifact | ||
|
@@ -58,88 +58,88 @@ jobs: | |
ls | ||
- name: Check for schema updates | ||
uses: actions/github-script@v7 | ||
id: schema-diff | ||
uses: actions/github-script@v7 | ||
with: | ||
script: | | ||
const script = require('./scripts/schema-diff-reporter.js') | ||
await script({core}) | ||
- name: Send report to Slack | ||
id: slack | ||
uses: slackapi/[email protected] | ||
with: | ||
# Uses Slack's Block Kit to build the message | ||
# https://app.slack.com/block-kit-builder | ||
payload: | | ||
{ | ||
"blocks": [ | ||
{ | ||
"type": "section", | ||
"text": { | ||
"type": "mrkdwn", | ||
"text": ":mag_right: *New Relic Client Go | NerdGraph API Report*" | ||
} | ||
}, | ||
{ | ||
"type": "section", | ||
"text": { | ||
"type": "mrkdwn", | ||
"text": "*API Mutations Count:* ${{ steps.schema-diff.outputs.total_api_mutations_count }}\n*Client Mutations Count:* ${{ steps.schema-diff.outputs.client_mutations_count }}\n*Client Mutations Missing Count:* ${{ steps.schema-diff.outputs.client_mutations_missing_count }}\n" | ||
} | ||
}, | ||
{ | ||
"type": "divider" | ||
}, | ||
{ | ||
"type": "section", | ||
"text": { | ||
"type": "mrkdwn", | ||
"text": "*New API Mutations*" | ||
} | ||
}, | ||
{ | ||
"type": "context", | ||
"elements": [ | ||
{ | ||
"type": "plain_text", | ||
"text": ${{ toJSON(steps.schema-diff.outputs.new_api_mutations) }} | ||
} | ||
] | ||
}, | ||
{ | ||
"type": "section", | ||
"text": { | ||
"type": "mrkdwn", | ||
"text": "More information can be viewed in the job summary. ${{ steps.schema-diff.outputs.hero_mention }}" | ||
}, | ||
"accessory": { | ||
"type": "button", | ||
"text": { | ||
"type": "plain_text", | ||
"text": "Job Summary", | ||
"emoji": true | ||
}, | ||
"value": "View Job Summary", | ||
"url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}", | ||
"action_id": "button-action" | ||
} | ||
}, | ||
{ | ||
"type": "divider" | ||
}, | ||
{ | ||
"type": "section", | ||
"text": { | ||
"type": "mrkdwn", | ||
"text": "\n\n" | ||
} | ||
} | ||
] | ||
} | ||
env: | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | ||
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK | ||
# - name: Send report to Slack | ||
# id: slack | ||
# uses: slackapi/[email protected] | ||
# with: | ||
# # Uses Slack's Block Kit to build the message | ||
# # https://app.slack.com/block-kit-builder | ||
# payload: | | ||
# { | ||
# "blocks": [ | ||
# { | ||
# "type": "section", | ||
# "text": { | ||
# "type": "mrkdwn", | ||
# "text": ":mag_right: *New Relic Client Go | NerdGraph API Report*" | ||
# } | ||
# }, | ||
# { | ||
# "type": "section", | ||
# "text": { | ||
# "type": "mrkdwn", | ||
# "text": "*API Mutations Count:* ${{ steps.schema-diff.outputs.total_api_mutations_count }}\n*Client Mutations Count:* ${{ steps.schema-diff.outputs.client_mutations_count }}\n*Client Mutations Missing Count:* ${{ steps.schema-diff.outputs.client_mutations_missing_count }}\n" | ||
# } | ||
# }, | ||
# { | ||
# "type": "divider" | ||
# }, | ||
# { | ||
# "type": "section", | ||
# "text": { | ||
# "type": "mrkdwn", | ||
# "text": "*New API Mutations*" | ||
# } | ||
# }, | ||
# { | ||
# "type": "context", | ||
# "elements": [ | ||
# { | ||
# "type": "plain_text", | ||
# "text": ${{ toJSON(steps.schema-diff.outputs.new_api_mutations) }} | ||
# } | ||
# ] | ||
# }, | ||
# { | ||
# "type": "section", | ||
# "text": { | ||
# "type": "mrkdwn", | ||
# "text": "More information can be viewed in the job summary. ${{ steps.schema-diff.outputs.hero_mention }}" | ||
# }, | ||
# "accessory": { | ||
# "type": "button", | ||
# "text": { | ||
# "type": "plain_text", | ||
# "text": "Job Summary", | ||
# "emoji": true | ||
# }, | ||
# "value": "View Job Summary", | ||
# "url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}", | ||
# "action_id": "button-action" | ||
# } | ||
# }, | ||
# { | ||
# "type": "divider" | ||
# }, | ||
# { | ||
# "type": "section", | ||
# "text": { | ||
# "type": "mrkdwn", | ||
# "text": "\n\n" | ||
# } | ||
# } | ||
# ] | ||
# } | ||
# env: | ||
# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | ||
# SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK | ||
|
||
# After reporting changes to the schema, upload the most | ||
# recent version so we can compare on the next run. | ||
|
@@ -155,12 +155,15 @@ jobs: | |
if-no-files-found: error | ||
overwrite: true | ||
|
||
- name: Check tutone config output | ||
run: echo "${{ toJSON(needs.checkForApiUpdates.outputs.apiEndpoints) }}" | ||
|
||
generate-code: | ||
# if: steps.schema-diff.outputs.hero_mention != '' | ||
needs: checkForApiUpdates | ||
uses: newrelic/newrelic-client-go/.github/workflows/generate.yml@feat/automated-codegen | ||
with: | ||
apiEndpoints: '[autoflowsDeleteWorkflowDefinition, autoflowsStopWorkflowRun, autoflowsUpdateWorkflowDefinition]' # ${{needs.checkForApiUpdates.outputs.apiEndpoints}} | ||
apiEndpoints: ${{ needs.checkForApiUpdates.outputs.apiEndpoints }} # '[autoflowsDeleteWorkflowDefinition, autoflowsStopWorkflowRun, autoflowsUpdateWorkflowDefinition]' # ${{needs.checkForApiUpdates.outputs.apiEndpoints}} | ||
# secrets: | ||
# NEW_RELIC_API_KEY: ${{ secrets.NEW_RELIC_API_KEY }} | ||
# DEV_TOOLKIT_TOKEN: ${{ secrets.DEV_TOOLKIT_TOKEN }} | ||
|
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
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