Skip to content

Use the new inputs API #26605

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/azure-preview-env-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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]'
Expand All @@ -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'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/azure-preview-env-destroy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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'
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/azure-staging-build-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/purge-fastly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion .github/workflows/sync-codeql-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sync-openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/sync-search-elasticsearch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,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 <PATH>` option.
Expand All @@ -188,7 +188,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 }} \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Use `jobs.<job_id>.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!
```
Expand Down