From f142d4424d37aea55c895b85b6560a802c39d1fb Mon Sep 17 00:00:00 2001 From: Grace Park Date: Thu, 11 Jan 2024 10:35:32 -0800 Subject: [PATCH] Update content changes table workflow (#48658) --- .../content-changes-table-comment.yml | 32 +++---------------- .../content-changes-table-comment.js | 1 - 2 files changed, 4 insertions(+), 29 deletions(-) diff --git a/.github/workflows/content-changes-table-comment.yml b/.github/workflows/content-changes-table-comment.yml index aad89bcfbd..252c5a4734 100644 --- a/.github/workflows/content-changes-table-comment.yml +++ b/.github/workflows/content-changes-table-comment.yml @@ -20,6 +20,9 @@ on: description: 'Head SHA (latest sha of the PR)' type: string required: true + push: + paths: + - 'content/**' # Required in lieu of `pull_request` so that the content changes tables can be posts to PRs opened from a fork. pull_request_target: @@ -33,35 +36,8 @@ concurrency: cancel-in-progress: true jobs: - PR-Preview-Links: - if: github.event.pull_request.user.login != 'docs-bot' && (github.repository == 'github/docs-internal' || github.repository == 'github/docs') - name: Add staging/live links to PR - runs-on: ubuntu-latest - outputs: - filterContentDir: ${{ steps.filter.outputs.filterContentDir }} - steps: - - name: Check out repo - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 - - - name: Get files changed - uses: dorny/paths-filter@4512585405083f25c027a35db413c2b3b9006d50 - id: filter - with: - # Base branch used to get changed files - base: ${{ github.event.pull_request.base.ref }} - - # Enables setting an output in the format in `${FILTER_NAME}_files - # with the names of the matching files formatted as JSON array - list-files: json - - # Returns list of changed files matching each filter - filters: | - filterContentDir: - - 'content/**/*' - filterContentDir: - needs: PR-Preview-Links - if: ${{ needs.PR-Preview-Links.outputs.filterContentDir == 'true' && (github.repository == 'github/docs-internal' || github.repository == 'github/docs') }} + if: ${{ github.event.pull_request.user.login != 'docs-bot' && (github.repository == 'github/docs-internal' || github.repository == 'github/docs') }} runs-on: ubuntu-latest env: PR_NUMBER: ${{ github.event.pull_request.number || inputs.PR_NUMBER }} diff --git a/src/workflows/content-changes-table-comment.js b/src/workflows/content-changes-table-comment.js index d2b2afa521..1d4cbfa7da 100755 --- a/src/workflows/content-changes-table-comment.js +++ b/src/workflows/content-changes-table-comment.js @@ -63,7 +63,6 @@ async function main(owner, repo, baseSHA, headSHA) { }) const { files } = response.data - const markdownTableHead = [ '| **Source** | **Preview** | **Production** | **What Changed** |', '|:----------- |:----------- |:----------- |:----------- |',