Fix git branch inconsistencies for Actions (#18309)
* Update workflows to pass appropriate branch name for pull_request events * Update Docker building workflow to check appropriate branch name for pull_request events * Update Windows testing workflow for consistency with non-Windows testing workflow * Reorder if conditional check * Update workflow comment
This commit is contained in:
2
.github/workflows/build-docker-image.yml
vendored
2
.github/workflows/build-docker-image.yml
vendored
@@ -14,7 +14,7 @@ env:
|
||||
jobs:
|
||||
build:
|
||||
# Do not run this job for translations PRs
|
||||
if: ${{ github.ref != 'refs/heads/translations' }}
|
||||
if: ${{ github.head_ref != 'translations' && github.ref != 'refs/heads/translations' }}
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
||||
2
.github/workflows/link-check-dotcom.yml
vendored
2
.github/workflows/link-check-dotcom.yml
vendored
@@ -47,7 +47,7 @@ jobs:
|
||||
# run: npm run heroku-postbuild
|
||||
# env:
|
||||
# DOCUBOT_REPO_PAT: ${{ secrets.DOCUBOT_REPO_PAT }}
|
||||
# GIT_BRANCH: ${{ github.ref }}
|
||||
# GIT_BRANCH: ${{ github.head_ref || github.ref }}
|
||||
|
||||
- if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
|
||||
name: Build
|
||||
|
||||
2
.github/workflows/link-check-ghae.yml
vendored
2
.github/workflows/link-check-ghae.yml
vendored
@@ -47,7 +47,7 @@ jobs:
|
||||
# run: npm run heroku-postbuild
|
||||
# env:
|
||||
# DOCUBOT_REPO_PAT: ${{ secrets.DOCUBOT_REPO_PAT }}
|
||||
# GIT_BRANCH: ${{ github.ref }}
|
||||
# GIT_BRANCH: ${{ github.head_ref || github.ref }}
|
||||
|
||||
- if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
|
||||
name: Build
|
||||
|
||||
2
.github/workflows/link-check-ghes.yml
vendored
2
.github/workflows/link-check-ghes.yml
vendored
@@ -47,7 +47,7 @@ jobs:
|
||||
# run: npm run heroku-postbuild
|
||||
# env:
|
||||
# DOCUBOT_REPO_PAT: ${{ secrets.DOCUBOT_REPO_PAT }}
|
||||
# GIT_BRANCH: ${{ github.ref }}
|
||||
# GIT_BRANCH: ${{ github.head_ref || github.ref }}
|
||||
|
||||
- if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
|
||||
name: Build
|
||||
|
||||
19
.github/workflows/test-windows.yml
vendored
19
.github/workflows/test-windows.yml
vendored
@@ -1,4 +1,4 @@
|
||||
# NOTE: Changes to this file should also be applied to './test.yml' and './test-translations.yml'
|
||||
# NOTE: Changes to this file should also be applied to './test.yml'
|
||||
|
||||
name: Node.js Tests - Windows
|
||||
|
||||
@@ -8,10 +8,14 @@ on:
|
||||
schedule:
|
||||
- cron: '50 19 * * *' # once a day at 19:50 UTC / 11:50 PST
|
||||
|
||||
env:
|
||||
CI: true
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: windows-latest
|
||||
if: (github.event_name != 'pull_request') || (github.event_name == 'pull_request' && (contains(github.event.pull_request.labels.*.name, 'Windows') || contains(github.event.pull_request.labels.*.name, 'windows')))
|
||||
timeout-minutes: 60
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
@@ -19,6 +23,9 @@ jobs:
|
||||
steps:
|
||||
- name: Check out repo
|
||||
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
||||
with:
|
||||
# Enables cloning the Early Access repo later with the relevant PAT
|
||||
persist-credentials: 'false'
|
||||
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@c46424eee26de4078d34105d3de3cc4992202b1e
|
||||
@@ -41,7 +48,15 @@ jobs:
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Run build script
|
||||
- if: ${{ github.repository == 'github/docs-internal' }}
|
||||
name: Clone early access
|
||||
run: npm run heroku-postbuild
|
||||
env:
|
||||
DOCUBOT_REPO_PAT: ${{ secrets.DOCUBOT_REPO_PAT }}
|
||||
GIT_BRANCH: ${{ github.head_ref || github.ref }}
|
||||
|
||||
- if: ${{ github.repository != 'github/docs-internal' }}
|
||||
name: Run build script
|
||||
run: npm run build
|
||||
|
||||
- name: Run tests
|
||||
|
||||
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
@@ -77,7 +77,7 @@ jobs:
|
||||
run: npm run heroku-postbuild
|
||||
env:
|
||||
DOCUBOT_REPO_PAT: ${{ secrets.DOCUBOT_REPO_PAT }}
|
||||
GIT_BRANCH: ${{ github.ref }}
|
||||
GIT_BRANCH: ${{ github.head_ref || github.ref }}
|
||||
|
||||
- if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' && github.repository != 'github/docs-internal' }}
|
||||
name: Run build script
|
||||
|
||||
Reference in New Issue
Block a user