-
Notifications
You must be signed in to change notification settings - Fork 302
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Restore datasource validation and creation workflow
- Loading branch information
Andrew Anguiano
committed
Sep 19, 2024
1 parent
2f426f7
commit 831a96a
Showing
1 changed file
with
54 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: Validate data sources | ||
|
||
on: | ||
workflow_run: | ||
workflows: ["Validation Gate"] | ||
types: | ||
- completed | ||
|
||
jobs: | ||
validate-data-source-schema: | ||
name: Validate data source schema | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Download artifact | ||
uses: dawidd6/action-download-artifact@268677152d06ba59fcec7a7f0b5d961b6ccd7e1e | ||
with: | ||
workflow: validation_gate.yml | ||
run_id: ${{ github.event.workflow_run.id }} | ||
|
||
- name: Get PR number | ||
id: get_pr_number | ||
run: | | ||
export PR_NUMBER=$(cat artifact/pr_number.txt) | ||
echo "pr-number=$PR_NUMBER" >> $GITHUB_ENV | ||
- name: Checkout repository | ||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 | ||
with: | ||
ref: "refs/pull/${{ env.pr-number }}/merge" | ||
|
||
- name: Setup workspace | ||
uses: "./.github/actions/bootstrap" | ||
|
||
- name: Validate new files | ||
id: validation | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NR_API_URL: ${{ secrets.NR_API_URL }} | ||
NR_API_TOKEN: ${{ secrets.NR_API_TOKEN }} | ||
NEW_RELIC_NO_CONFIG_FILE: true | ||
NEW_RELIC_LICENSE_KEY: ${{ secrets.NEW_RELIC_LICENSE_KEY }} | ||
NEW_RELIC_APP_NAME: ${{ secrets.NEW_RELIC_APP_NAME }} | ||
NEW_RELIC_HOST: staging-collector.newrelic.com | ||
NODE_ENV: production | ||
PR_NUMBER: ${{ env.pr-number }} | ||
run: | | ||
URL="https://api.github.com/repos/${GITHUB_REPOSITORY}/pulls/$PR_NUMBER/files" | ||
DRY_RUN=true | ||
cd utils && yarn create-validate-data-sources $URL $DRY_RUN | ||
- name: Add commit status | ||
if: always() | ||
uses: "./.github/actions/add-commit-status" | ||
with: | ||
statusContext: "Validation / Data source schema compliance" | ||
state: ${{ job.status }} |