1
0
mirror of synced 2026-01-08 12:01:53 -05:00

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:
James M. Greene
2021-03-18 14:31:31 -05:00
committed by GitHub
parent 48623dc9ee
commit 0eec258c01
7 changed files with 23 additions and 8 deletions

View File

@@ -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:

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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