diff --git a/.github/workflows/repo-sync-stalls.yml b/.github/workflows/repo-sync-stalls.yml deleted file mode 100644 index 2ff7b8a78196..000000000000 --- a/.github/workflows/repo-sync-stalls.yml +++ /dev/null @@ -1,64 +0,0 @@ -name: Repo Sync Stalls - -# **What it does**: This lets us know in Slack if repo-sync doesn't happen in a timely manner. -# **Why we have it**: We want repo-sync to keep the two repositories in sync with each other. -# **Who does it impact**: Open-source contributors, docs engineering. - -on: - workflow_dispatch: - schedule: - - cron: '20 */2 * * *' # Run every 2nd hour at 20 minutes after - -permissions: - contents: read - pull-requests: read - -jobs: - repo-sync-stalls: - if: github.repository == 'github/docs-internal' || github.repository == 'github/docs' - runs-on: ubuntu-latest - steps: - - name: Check if repo sync is stalled - uses: actions/github-script@e69ef5462fd455e02edcaf4dd7708eda96b9eda0 - with: - script: | - let pulls; - const owner = context.repo.owner - const repo = context.repo.repo - try { - pulls = await github.rest.pulls.list({ - owner: owner, - repo: repo, - head: `${owner}:repo-sync`, - state: 'open' - }); - } catch(err) { - throw err - return - } - - // Remove all pull requests that don't have the - // 'automated-reposync-pr' label - pulls.data = pulls.data.filter(pr => - pr.labels.some(label => label.name === 'automated-reposync-pr') - ) - - // Search for pull requests that have been open too long - pulls.data.forEach(pr => { - const timeDelta = Date.now() - Date.parse(pr.created_at); - const minutesOpen = timeDelta / 1000 / 60; - - if (minutesOpen > 180) { - core.setFailed('Repo sync appears to be stalled') - } - }) - - - name: Check out repo - if: ${{ failure() && github.event_name != 'workflow_dispatch' }} - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - - uses: ./.github/actions/slack-alert - if: ${{ failure() && github.event_name != 'workflow_dispatch' }} - with: - slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }} - slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }} diff --git a/.github/workflows/repo-sync.yml b/.github/workflows/repo-sync.yml index 5dd70d12a8c9..d4f549a1f7f1 100644 --- a/.github/workflows/repo-sync.yml +++ b/.github/workflows/repo-sync.yml @@ -10,7 +10,7 @@ name: Repo Sync on: workflow_dispatch: schedule: - - cron: '20,50 * * * *' # Run every hour at 20 and 50 minutes after + - cron: '20 */3 * * *' # Run every 3rd hour at 20 minutes after permissions: contents: write