diff --git a/.github/workflows/add-netlify-links.yml b/.github/workflows/add-netlify-links.yml index ed24310d0..2e9eca919 100644 --- a/.github/workflows/add-netlify-links.yml +++ b/.github/workflows/add-netlify-links.yml @@ -2,6 +2,8 @@ name: Add Netlify Links To Changed Pages on: workflow_call: pull_request_target: + paths-ignore: + - "source/**/*.ast" jobs: get-pr-changes: name: Get Changed Files & Update PR Description diff --git a/.github/workflows/osiris-subpar-coverage.yml b/.github/workflows/osiris-subpar-coverage.yml new file mode 100644 index 000000000..1169b07ed --- /dev/null +++ b/.github/workflows/osiris-subpar-coverage.yml @@ -0,0 +1,71 @@ +name: Coverage Check for Osiris Generated AST files +on: + pull_request: + paths: + - '**/*.ast' # Only trigger if .ast files are changed + branches: + - main + +jobs: + check-coverage: + runs-on: ubuntu-latest + outputs: + site_coverage_list: ${{ steps.set_coverage.outputs.site_coverage_list }} + coverage_below_threshold: ${{ steps.set_coverage.outputs.coverage_below_threshold }} + + steps: + - name: Checkout Repos + uses: actions/checkout@v4 + # uncomment when running or testing locally using [act](https://github.com/nektos/act?tab=readme-ov-file) + # with: + # token: ${{ secrets.API_TOKEN_GITHUB }} + # ref: DOP-5399-placeholder + + - name: Verify Branch Checkout + run: | + git branch --show-current # Print the current branch + + - name: Install Wget + run: sudo apt-get update && sudo apt-get install -y wget + + - name: Clone Osiris + run: git clone https://x-access-token:${{ secrets.API_TOKEN_GITHUB }}@github.com/10gen/osiris.git cloned-osiris-repo + + - name: Run Coverage Check + id: run_coverage + uses: mongodb/docs-worker-actions/coverage-check@main + with: + repo-path: cloned-osiris-repo + required-coverage: '90' + + - name: Set Workflow Outputs + id: set_coverage + run: | + echo "coverage_below_threshold=${coverage_below_threshold}" >> $GITHUB_OUTPUT + echo "site_coverage_list=${SITE_COVERAGE_LIST}" >> $GITHUB_OUTPUT + + send-slack-notification: + runs-on: ubuntu-latest + needs: check-coverage + if: needs.check-coverage.outputs.coverage_below_threshold == 'true' + + steps: + - name: Send Slack Notification + env: + SITE_COVERAGE_LIST: ${{ needs.check-coverage.outputs.site_coverage_list }} + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + REPOSITORY: ${{ github.repository }} + PR_TITLE: ${{ github.event.pull_request.title }} + PR_NUMBER: ${{ github.event.pull_request.number }} + PR_URL: ${{ github.event.pull_request.html_url }} + PR_SHA: ${{ github.event.pull_request.head.sha }} + uses: mongodb/docs-worker-actions/coverage-report-to-slack@main + with: + required-coverage: '90' + site-coverage-list: $SITE_COVERAGE_LIST + slack-webhook-url: $SLACK_WEBHOOK_URL + repository: $REPOSITORY + pr-title: $PR_TITLE + pr-number: $PR_NUMBER + pr-url: $PR_URL + pr-sha: $PR_SHA \ No newline at end of file diff --git a/.github/workflows/vale-tdbx.yml b/.github/workflows/vale-tdbx.yml index d748e941c..a6763d09e 100644 --- a/.github/workflows/vale-tdbx.yml +++ b/.github/workflows/vale-tdbx.yml @@ -3,6 +3,8 @@ on: pull_request: paths: - "source/**" + paths-ignore: + - "source/**/*.ast" jobs: vale: diff --git a/.gitignore b/.gitignore index 49c66f9d2..2a4b4a887 100644 --- a/.gitignore +++ b/.gitignore @@ -34,3 +34,7 @@ giza.log .vscode* *.swp *.code-workspace + +# GitHub Actions +.secrets +event.json \ No newline at end of file