From 450362f6000ac5827bdfb4f123efd0f539f5bb47 Mon Sep 17 00:00:00 2001 From: Jeff Widman Date: Tue, 11 Jul 2023 13:59:51 -0700 Subject: [PATCH] Use the new `inputs` API --- .github/workflows/azure-preview-env-deploy.yml | 10 +++++----- .github/workflows/azure-preview-env-destroy.yml | 4 ++-- .github/workflows/azure-staging-build-deploy.yml | 8 ++++---- .github/workflows/purge-fastly.yml | 6 +++--- .github/workflows/sync-codeql-cli.yml | 2 +- .github/workflows/sync-openapi.yml | 2 +- .github/workflows/sync-search-elasticsearch.yml | 4 ++-- .../jobs/section-choosing-the-runner-for-a-job.md | 2 +- 8 files changed, 19 insertions(+), 19 deletions(-) diff --git a/.github/workflows/azure-preview-env-deploy.yml b/.github/workflows/azure-preview-env-deploy.yml index 7b574d6a681e..6dc2fab470a4 100644 --- a/.github/workflows/azure-preview-env-deploy.yml +++ b/.github/workflows/azure-preview-env-deploy.yml @@ -44,7 +44,7 @@ permissions: # This allows one deploy workflow to interrupt another concurrency: - group: 'preview-env @ ${{ github.head_ref || github.run_id }} for ${{ github.event.number || github.event.inputs.PR_NUMBER }}' + group: 'preview-env @ ${{ github.head_ref || github.run_id }} for ${{ github.event.number || inputs.PR_NUMBER }}' cancel-in-progress: true jobs: @@ -56,8 +56,8 @@ jobs: # See https://bit.ly/3qB9nZW > If a job in a workflow is skipped due to a conditional, it will report its status as "Success". if: | ( - (github.event.pull_request.head.sha || github.event.inputs.COMMIT_REF) - && (github.event.number || github.event.inputs.PR_NUMBER || github.run_id) + (github.event.pull_request.head.sha || inputs.COMMIT_REF) + && (github.event.number || inputs.PR_NUMBER || github.run_id) ) && (github.repository == 'github/docs-internal' || github.repository == 'github/docs') && github.actor != 'dependabot[bot]' @@ -70,8 +70,8 @@ jobs: # to link a PR to a list of environments later. url: ${{ env.APP_URL }} env: - PR_NUMBER: ${{ github.event.number || github.event.inputs.PR_NUMBER || github.run_id }} - COMMIT_REF: ${{ github.event.pull_request.head.sha || github.event.inputs.COMMIT_REF }} + PR_NUMBER: ${{ github.event.number || inputs.PR_NUMBER || github.run_id }} + COMMIT_REF: ${{ github.event.pull_request.head.sha || inputs.COMMIT_REF }} BRANCH_NAME: ${{ github.head_ref || github.ref_name }} IS_INTERNAL_BUILD: ${{ github.repository == 'github/docs-internal' }} # This may also run in forked repositories, not just 'github/docs' diff --git a/.github/workflows/azure-preview-env-destroy.yml b/.github/workflows/azure-preview-env-destroy.yml index 2f0b4510c062..298deeb05456 100644 --- a/.github/workflows/azure-preview-env-destroy.yml +++ b/.github/workflows/azure-preview-env-destroy.yml @@ -21,7 +21,7 @@ permissions: # This allows one deploy workflow to interrupt another concurrency: - group: 'preview-env @ ${{ github.head_ref || github.run_id }} for ${{ github.event.number || github.event.inputs.PR_NUMBER }}' + group: 'preview-env @ ${{ github.head_ref || github.run_id }} for ${{ github.event.number || inputs.PR_NUMBER }}' cancel-in-progress: true jobs: @@ -31,7 +31,7 @@ jobs: if: github.repository == 'github/docs-internal' || github.repository == 'github/docs' timeout-minutes: 5 env: - PR_NUMBER: ${{ github.event.number || github.event.inputs.PR_NUMBER }} + PR_NUMBER: ${{ github.event.number || inputs.PR_NUMBER }} steps: - name: 'Az CLI login' diff --git a/.github/workflows/azure-staging-build-deploy.yml b/.github/workflows/azure-staging-build-deploy.yml index 403f557a7415..4a758f26cd7c 100644 --- a/.github/workflows/azure-staging-build-deploy.yml +++ b/.github/workflows/azure-staging-build-deploy.yml @@ -23,7 +23,7 @@ permissions: # This allows a subsequently queued workflow run to take priority over # previously queued runs but NOT interrupt currently executing runs concurrency: - group: 'staging-env @ ${{ github.head_ref || github.run_id }} for ${{ github.event.number || github.event.inputs.PR_NUMBER }}' + group: 'staging-env @ ${{ github.head_ref || github.run_id }} for ${{ github.event.number || inputs.PR_NUMBER }}' cancel-in-progress: true jobs: @@ -36,9 +36,9 @@ jobs: name: staging-env url: ${{ env.APP_URL }} env: - PR_NUMBER: ${{ github.event.number || github.event.inputs.PR_NUMBER || github.run_id }} - COMMIT_REF: ${{ github.event.pull_request.head.sha || github.event.inputs.COMMIT_REF }} - IMAGE_REPO: ${{ github.repository }}/pr-${{ github.event.number || github.event.inputs.PR_NUMBER || github.run_id }} + PR_NUMBER: ${{ github.event.number || inputs.PR_NUMBER || github.run_id }} + COMMIT_REF: ${{ github.event.pull_request.head.sha || inputs.COMMIT_REF }} + IMAGE_REPO: ${{ github.repository }}/pr-${{ github.event.number || inputs.PR_NUMBER || github.run_id }} RESOURCE_GROUP_NAME: docs-staging APP_SERVICE_NAME: ghdocs-staging SLOT_NAME: canary diff --git a/.github/workflows/purge-fastly.yml b/.github/workflows/purge-fastly.yml index c2a8567ca2d3..17d99e20207d 100644 --- a/.github/workflows/purge-fastly.yml +++ b/.github/workflows/purge-fastly.yml @@ -39,11 +39,11 @@ jobs: - uses: ./.github/actions/node-npm-setup - name: Purge Fastly edge cache independent of language - if: ${{ github.event.inputs.nuke_all }} + if: ${{ inputs.nuke_all }} run: .github/actions-scripts/purge-fastly-edge-cache.js - name: Purge Fastly edge cache per language - if: ${{ !github.event.inputs.nuke_all }} + if: ${{ !inputs.nuke_all }} env: - LANGUAGES: ${{ github.event.inputs.languages }} + LANGUAGES: ${{ inputs.languages }} run: .github/actions-scripts/purge-fastly-edge-cache-per-language.js diff --git a/.github/workflows/sync-codeql-cli.yml b/.github/workflows/sync-codeql-cli.yml index 0e2cecb5413f..39720ec0b95c 100644 --- a/.github/workflows/sync-codeql-cli.yml +++ b/.github/workflows/sync-codeql-cli.yml @@ -46,7 +46,7 @@ jobs: token: ${{ secrets.DOCS_BOT_PAT_WRITEORG_PROJECT }} repository: github/semmle-code path: semmle-code - ref: ${{ github.event.inputs.SOURCE_BRANCH }} + ref: ${{ inputs.SOURCE_BRANCH }} - uses: ./.github/actions/node-npm-setup diff --git a/.github/workflows/sync-openapi.yml b/.github/workflows/sync-openapi.yml index 8ef273caf516..e98fb9c6acab 100644 --- a/.github/workflows/sync-openapi.yml +++ b/.github/workflows/sync-openapi.yml @@ -45,7 +45,7 @@ jobs: # will be checked out repository: github/rest-api-description path: rest-api-description - ref: ${{ github.event.inputs.SOURCE_BRANCH }} + ref: ${{ inputs.SOURCE_BRANCH }} - uses: ./.github/actions/node-npm-setup diff --git a/.github/workflows/sync-search-elasticsearch.yml b/.github/workflows/sync-search-elasticsearch.yml index 4b19f97f65e9..75f25b9f72e3 100644 --- a/.github/workflows/sync-search-elasticsearch.yml +++ b/.github/workflows/sync-search-elasticsearch.yml @@ -159,7 +159,7 @@ jobs: # Note that by default, this is '' (empty string) and that means # the same as not set within the script. - VERSION: ${{ github.event.inputs.version }} + VERSION: ${{ inputs.version }} # The sync-search-index recognizes this env var if you don't # use the `--popular-pags ` option. @@ -181,7 +181,7 @@ jobs: # Must match what we used when scraping (npm run sync-search-indices) # otherwise the script will seek other versions from disk that might # not exist. - VERSION: ${{ github.event.inputs.version }} + VERSION: ${{ inputs.version }} run: | ./src/search/scripts/index-elasticsearch.js /tmp/records \ --language ${{ matrix.language }} \ diff --git a/data/reusables/actions/jobs/section-choosing-the-runner-for-a-job.md b/data/reusables/actions/jobs/section-choosing-the-runner-for-a-job.md index 6512d383af6c..5c298dbfe50c 100644 --- a/data/reusables/actions/jobs/section-choosing-the-runner-for-a-job.md +++ b/data/reusables/actions/jobs/section-choosing-the-runner-for-a-job.md @@ -32,7 +32,7 @@ Use `jobs..runs-on` to define the type of machine to run the job on. jobs: test: - runs-on: [self-hosted, "${{ github.event.inputs.chosen-os }}"] + runs-on: [self-hosted, "${{ inputs.chosen-os }}"] steps: - run: echo Hello world! ```