Skip to content

Commit

Permalink
chore: testing message output for conditional job handling
Browse files Browse the repository at this point in the history
  • Loading branch information
sanderblue committed May 14, 2024
1 parent 6080082 commit 86a931d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 16 deletions.
21 changes: 9 additions & 12 deletions .github/workflows/graphql-schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ on:
# - cron: '5 5 * * 1'

jobs:
downloadSchema:
checkForApiUpdates:
name: Check for API updates
runs-on: ubuntu-latest
steps:
- name: Install Node
Expand Down Expand Up @@ -63,7 +64,7 @@ jobs:
- name: Send report to Slack
id: slack
if: ${{ always() }}
if: ${{ steps.schema-diff.outputs.new_endpoints != '' }}
uses: slackapi/slack-github-action@v1.26
with:
# Uses Slack's Block Kit to build the message
Expand Down Expand Up @@ -109,16 +110,12 @@ jobs:
# - name: Checkout code
# uses: actions/checkout@v3

# # - name: Fetch GraphQL Schema
# # env:
# # NEW_RELIC_API_KEY: ${{ secrets.NEW_RELIC_API_KEY }}
# # run: |
# # go install github.com/newrelic/tutone/cmd/tutone@latest
# # tutone fetch --refetch
# # ls

# # - name: Check for schema updates
# # run: ./scripts/schema-diff.js
# - name: Fetch GraphQL Schema
# env:
# NEW_RELIC_API_KEY: ${{ secrets.NEW_RELIC_API_KEY }}
# run: |
# go install github.com/newrelic/tutone/cmd/tutone@latest
# tutone fetch --refetch

# - name: Upload latest schema.json
# uses: actions/upload-artifact@v4
Expand Down
8 changes: 4 additions & 4 deletions scripts/schema-diff.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ module.exports = async ({

console.log("New Endpoints:", endpointsDiff);

let message = "No NerdGraph API updates since the last check."
if (endpointsDiff.length > 0) {
message = `'${endpointsDiff.join('\n')}'`
}
let message = null
// if (endpointsDiff.length > 0) {
// message = `'${endpointsDiff.join('\n')}'`
// }

core.setOutput('new_endpoints', message);
}

0 comments on commit 86a931d

Please sign in to comment.