Skip to content

Commit

Permalink
Create src/workflows, clear out github/actions-scripts (#43088)
Browse files Browse the repository at this point in the history
  • Loading branch information
heiskr authored Sep 25, 2023
1 parent 69ac3e6 commit 4870ba6
Show file tree
Hide file tree
Showing 41 changed files with 36 additions and 101 deletions.
63 changes: 0 additions & 63 deletions .github/actions-scripts/compress-large-files.js

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/azure-preview-env-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ jobs:
- name: Get preview app info
env:
APP_NAME_SEED: ${{ secrets.PREVIEW_ENV_NAME_SEED }}
run: .github/actions-scripts/get-preview-app-info.sh
run: src/workflows/get-preview-app-info.sh

- name: 'Set env vars'
run: |
Expand Down Expand Up @@ -210,7 +210,7 @@ jobs:

# In addition to making the final image smaller, we also save time by not sending unnecessary files to the docker build context
- name: 'Prune for preview env'
run: .github/actions-scripts/prune-for-preview-env.sh
run: src/workflows/prune-for-preview-env.sh

- name: 'Build and push image'
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/azure-preview-env-destroy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
- name: Get preview app info
env:
APP_NAME_SEED: ${{ secrets.PREVIEW_ENV_NAME_SEED }}
run: .github/actions-scripts/get-preview-app-info.sh
run: src/workflows/get-preview-app-info.sh

# Succeed despite any non-zero exit code (e.g. if there is no deployment to cancel)
- name: 'Cancel any in progress deployments'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/content-changes-table-comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
- name: Get preview app info
env:
APP_NAME_SEED: ${{ secrets.PREVIEW_ENV_NAME_SEED }}
run: .github/actions-scripts/get-preview-app-info.sh
run: src/workflows/get-preview-app-info.sh

- name: Setup Node.js
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516
Expand All @@ -72,7 +72,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
APP_URL: ${{ env.APP_URL }}
run: .github/actions-scripts/content-changes-table-comment.js
run: src/workflows/content-changes-table-comment.js

- name: Find content directory changes comment
uses: peter-evans/find-comment@f4499a714d59013c74a08789b48abe4b704364a0
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docs-review-collect.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:

- name: Run script for github
run: |
node .github/actions-scripts/fr-add-docs-reviewers-requests.js
node src/workflows/fr-add-docs-reviewers-requests.js
env:
TOKEN: ${{ secrets.DOCS_BOT_PAT_WRITEORG_PROJECT }}
PROJECT_NUMBER: 2936
Expand All @@ -44,7 +44,7 @@ jobs:

- name: Run script for audit-log-allowlists
run: |
node .github/actions-scripts/fr-add-docs-reviewers-requests.js
node src/workflows/fr-add-docs-reviewers-requests.js
env:
TOKEN: ${{ secrets.DOCS_BOT_PAT_WRITEORG_PROJECT }}
PROJECT_NUMBER: 2936
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/enterprise-dates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.DOCS_BOT_PAT_READPUBLICKEY }}
AUTOMERGE_PR_NUMBER: ${{ steps.create-pull-request.outputs.pull-request-number }}
run: node .github/actions-scripts/enable-automerge.js
run: node src/workflows/enable-automerge.js

- if: ${{ failure() && env.FREEZE != 'true' }}
name: Delete remote branch (if previous steps failed)
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint-entire-content-data-markdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ jobs:
REPORT_AUTHOR: docs-bot
REPORT_LABEL: broken content markdown report
REPORT_REPOSITORY: github/docs-content
run: node .github/actions-scripts/post-lints.js --path /tmp/error-lints.json
run: node src/content-linter/scripts/post-lints.js --path /tmp/error-lints.json
2 changes: 1 addition & 1 deletion .github/workflows/local-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
curl --fail --retry-connrefused --retry 5 http://localhost:4000/
- name: Run basic tests
run: node .github/actions-scripts/test-local-dev.js
run: node src/workflows/test-local-dev.js

- if: ${{ failure() }}
name: Debug server outputs on errors
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main-preview-docker-cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:

# In addition to making the final image smaller, we also save time by not sending unnecessary files to the docker build context
- name: 'Prune for preview env'
run: .github/actions-scripts/prune-for-preview-env.sh
run: src/workflows/prune-for-preview-env.sh

- name: 'Build and push image'
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/manually-purge-fastly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ jobs:
FASTLY_TOKEN: ${{ secrets.FASTLY_TOKEN }}
FASTLY_SERVICE_ID: ${{ secrets.FASTLY_SERVICE_ID }}
FASTLY_SURROGATE_KEY: 'manual-purge'
run: .github/actions-scripts/purge-fastly-edge-cache.js
run: src/workflows/purge-fastly-edge-cache.js
2 changes: 1 addition & 1 deletion .github/workflows/notify-about-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
timeout-minutes: 3
env:
GITHUB_TOKEN: ${{ secrets.DOCS_BOT_PAT_READPUBLICKEY }}
run: .github/actions-scripts/find-past-built-pr.js
run: src/workflows/find-past-built-pr.js

- name: Find content directory changes comment
if: ${{ steps.get-number.outputs.number != '' }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/os-ready-for-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:

- name: Run script
run: |
node .github/actions-scripts/ready-for-docs-review.js
node src/workflows/ready-for-docs-review.js
env:
TOKEN: ${{ secrets.DOCS_BOT_PAT_WRITEORG_PROJECT }}
PROJECT_NUMBER: 2936
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/purge-fastly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:

- name: Purge Fastly edge cache independent of language
if: ${{ inputs.nuke_all }}
run: .github/actions-scripts/purge-fastly-edge-cache.js
run: src/workflows/purge-fastly-edge-cache.js

- name: Purge Fastly edge cache per language
if: ${{ !inputs.nuke_all }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/purge-old-deployment-environments.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
GITHUB_REPOSITORY: ${{ github.repository }}
# Necessary to be able to delete deployment environments
GITHUB_TOKEN: ${{ secrets.DOCS_BOT_PAT_WORKFLOW_READORG }}
run: .github/actions-scripts/purge-old-deployment-environments.js
run: src/workflows/purge-old-deployment-environments.js

- name: Send Slack notification if workflow fails
uses: someimportantcompany/github-actions-slack-message@1d367080235edfa53df415bd8e0bbab480f29bad
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/purge-old-workflow-runs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
GITHUB_REPOSITORY: ${{ github.repository }}
# Necessary to be able to delete deployment environments
GITHUB_TOKEN: ${{ secrets.DOCS_BOT_PAT_WORKFLOW_READORG }}
run: .github/actions-scripts/purge-old-workflow-runs.js
run: src/workflows/purge-old-workflow-runs.js

- name: Send Slack notification if workflow fails
uses: someimportantcompany/github-actions-slack-message@1d367080235edfa53df415bd8e0bbab480f29bad
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ready-for-doc-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:

- name: Run script
run: |
node .github/actions-scripts/ready-for-docs-review.js
node src/workflows/ready-for-docs-review.js
env:
TOKEN: ${{ secrets.DOCS_BOT_PAT_WRITEORG_PROJECT }}
PROJECT_NUMBER: 2936
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sync-graphql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.DOCS_BOT_PAT_READPUBLICKEY }}
AUTOMERGE_PR_NUMBER: ${{ steps.create-pull-request.outputs.pull-request-number }}
run: node .github/actions-scripts/enable-automerge.js
run: node src/workflows/enable-automerge.js

- if: ${{ failure() && env.FREEZE != 'true'}}
name: Delete remote branch (if previous steps failed)
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sync-search-elasticsearch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ jobs:
FASTLY_TOKEN: ${{ secrets.FASTLY_TOKEN }}
FASTLY_SERVICE_ID: ${{ secrets.FASTLY_SERVICE_ID }}
FASTLY_SURROGATE_KEY: api-search:${{ matrix.language }}
run: .github/actions-scripts/purge-fastly-edge-cache.js
run: src/workflows/purge-fastly-edge-cache.js

- name: Send Slack notification if workflow fails
uses: someimportantcompany/github-actions-slack-message@1d367080235edfa53df415bd8e0bbab480f29bad
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ jobs:
# - tools
- versions
- webhooks
# - workflows

# The languages suite only runs on docs-internal
isPrivateRepo:
Expand Down
2 changes: 1 addition & 1 deletion script/content-changes-table-comment.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
// [end-readme]

import { program } from 'commander'
import main from '../.github/actions-scripts/content-changes-table-comment.js'
import main from '#src/workflows/content-changes-table-comment.js'

program
.description('Produce a nice table based on the branch diff')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import { program } from 'commander'
import fs from 'fs'
import coreLib from '@actions/core'

import github from '../../script/helpers/github.js'
import { getEnvInputs } from './lib/get-env-inputs.js'
import { createReportIssue, linkReports } from './lib/issue-report.js'
import github from '../../../script/helpers/github.js'
import { getEnvInputs } from '../../../src/workflows/get-env-inputs.js'
import { createReportIssue, linkReports } from '../../../src/workflows/issue-report.js'

// [start-readme]
//
Expand Down
File renamed without changes.
16 changes: 5 additions & 11 deletions src/links/scripts/rendered-content-link-checker.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,13 @@ import warmServer from '../../../lib/warm-server.js'
import { liquid } from '#src/content-render/index.js'
import { deprecated } from '#src/versions/lib/enterprise-server-releases.js'
import excludedLinks from '#src/links/lib/excluded-links.js'
import { getEnvInputs, boolEnvVar } from '../../../.github/actions-scripts/lib/get-env-inputs.js'
import {
debugTimeEnd,
debugTimeStart,
} from '../../../.github/actions-scripts/lib/debug-time-taken.js'
import { uploadArtifact as uploadArtifactLib } from '../../../.github/actions-scripts/lib/upload-artifact.js'
import { getEnvInputs, boolEnvVar } from '../../../src/workflows/get-env-inputs.js'
import { debugTimeEnd, debugTimeStart } from './debug-time-taken.js'
import { uploadArtifact as uploadArtifactLib } from './upload-artifact.js'
import github from '../../../script/helpers/github.js'
import { getActionContext } from '../../../.github/actions-scripts/lib/action-context.js'
import { getActionContext } from '../../../src/workflows/action-context.js'
import { createMinimalProcessor } from '#src/content-render/unified/processor.js'
import {
createReportIssue,
linkReports,
} from '../../../.github/actions-scripts/lib/issue-report.js'
import { createReportIssue, linkReports } from '../../../src/workflows/issue-report.js'

const STATIC_PREFIXES = {
assets: path.resolve('assets'),
Expand Down
File renamed without changes.
3 changes: 3 additions & 0 deletions src/workflows/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Workflows

This directory contains workflow scripts that cannot otherwise be in other subject folders.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import parse from '../../lib/read-frontmatter.js'
import getApplicableVersions from '#src/versions/lib/get-applicable-versions.js'
import nonEnterpriseDefaultVersion from '#src/versions/lib/non-enterprise-default-version.js'
import { allVersionShortnames } from '#src/versions/lib/all-versions.js'
import { waitUntilUrlIsHealthy } from './lib/wait-until-url-is-healthy.js'
import { waitUntilUrlIsHealthy } from './wait-until-url-is-healthy.js'

const { GITHUB_TOKEN, APP_URL } = process.env
const context = github.context
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import got from 'got'
import { setOutput } from '@actions/core'

import github from '../../script/helpers/github.js'
import { getActionContext } from './lib/action-context.js'
import { getActionContext } from './action-context.js'

async function main() {
const sha = await getBuiltSHA()
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import got from 'got'
* For engineers to test this locally do the following:
*
* 1. Start `npm run dev` in one terminal
* 2. Run `./.github/actions-scripts/test-local-dev.js` in another terminal
* 2. Run `src/workflows/test-local-dev.js` in another terminal
*
*/

Expand Down
File renamed without changes.

0 comments on commit 4870ba6

Please sign in to comment.