mirror of
https://github.com/owncast/owncast.git
synced 2024-11-21 20:28:15 +03:00
fix(ci): split up checkout steps for push vs. pull request (#3911)
This commit is contained in:
parent
90b70612c9
commit
89a33ea4e3
15 changed files with 132 additions and 31 deletions
10
.github/workflows/actions-lint.yml
vendored
10
.github/workflows/actions-lint.yml
vendored
|
@ -13,7 +13,15 @@ jobs:
|
|||
name: GitHub actions
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Check out pull request code
|
||||
uses: actions/checkout@v4
|
||||
if: github.event_name == 'pull_request'
|
||||
with:
|
||||
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
||||
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v4
|
||||
if: github.event_name == 'push'
|
||||
|
||||
- uses: docker://rhysd/actionlint:latest
|
||||
with:
|
||||
|
|
|
@ -18,8 +18,15 @@ jobs:
|
|||
with:
|
||||
concurrent_skipping: 'same_content_newer'
|
||||
|
||||
- name: Checkout repository
|
||||
- name: Check out pull request code
|
||||
uses: actions/checkout@v4
|
||||
if: github.event_name == 'pull_request'
|
||||
with:
|
||||
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
||||
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v4
|
||||
if: github.event_name == 'push'
|
||||
|
||||
- name: Get changed files
|
||||
id: changed-files-yaml
|
||||
|
|
9
.github/workflows/browser-testing.yml
vendored
9
.github/workflows/browser-testing.yml
vendored
|
@ -19,8 +19,15 @@ jobs:
|
|||
with:
|
||||
concurrent_skipping: 'same_content_newer'
|
||||
|
||||
- name: Checkout
|
||||
- name: Check out pull request code
|
||||
uses: actions/checkout@v4
|
||||
if: github.event_name == 'pull_request'
|
||||
with:
|
||||
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
||||
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v4
|
||||
if: github.event_name == 'push'
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
|
|
9
.github/workflows/build-storybook.yml
vendored
9
.github/workflows/build-storybook.yml
vendored
|
@ -11,8 +11,15 @@ jobs:
|
|||
if: github.repository == 'owncast/owncast'
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
- name: Check out pull request code
|
||||
uses: actions/checkout@v4
|
||||
if: github.event_name == 'pull_request'
|
||||
with:
|
||||
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
||||
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v4
|
||||
if: github.event_name == 'push'
|
||||
|
||||
- name: Cache node modules
|
||||
uses: actions/cache@v4
|
||||
|
|
10
.github/workflows/chromatic.yml
vendored
10
.github/workflows/chromatic.yml
vendored
|
@ -28,13 +28,15 @@ jobs:
|
|||
with:
|
||||
concurrent_skipping: 'same_content_newer'
|
||||
|
||||
- name: Check out code
|
||||
- name: Check out pull request code
|
||||
uses: actions/checkout@v4
|
||||
if: github.event_name == 'pull_request'
|
||||
with:
|
||||
# Make sure the actual branch is checked out when running on pull requests
|
||||
ref: ${{ github.event.pull_request.head.ref }}
|
||||
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v4
|
||||
if: github.event_name == 'push'
|
||||
|
||||
- name: Get changed files
|
||||
id: changed-files-yaml
|
||||
|
|
9
.github/workflows/codeql-analysis.yml
vendored
9
.github/workflows/codeql-analysis.yml
vendored
|
@ -36,8 +36,15 @@ jobs:
|
|||
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
- name: Check out pull request code
|
||||
uses: actions/checkout@v4
|
||||
if: github.event_name == 'pull_request'
|
||||
with:
|
||||
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
||||
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v4
|
||||
if: github.event_name == 'push'
|
||||
|
||||
- uses: actions/setup-go@v5
|
||||
with:
|
||||
|
|
10
.github/workflows/container-lint.yml
vendored
10
.github/workflows/container-lint.yml
vendored
|
@ -19,7 +19,15 @@ jobs:
|
|||
container:
|
||||
image: aquasec/trivy
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Check out pull request code
|
||||
uses: actions/checkout@v4
|
||||
if: github.event_name == 'pull_request'
|
||||
with:
|
||||
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
||||
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v4
|
||||
if: github.event_name == 'push'
|
||||
|
||||
- name: Check critical issues
|
||||
run: trivy config --exit-code 1 --severity "HIGH,CRITICAL" ./Dockerfile
|
||||
|
|
9
.github/workflows/container.yaml
vendored
9
.github/workflows/container.yaml
vendored
|
@ -37,10 +37,15 @@ jobs:
|
|||
image: tonistiigi/binfmt:latest
|
||||
platforms: all
|
||||
|
||||
- name: Checkout repo
|
||||
- name: Check out pull request code
|
||||
uses: actions/checkout@v4
|
||||
if: github.event_name == 'pull_request'
|
||||
with:
|
||||
fetch-depth: 0
|
||||
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
||||
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v4
|
||||
if: github.event_name == 'push'
|
||||
|
||||
- name: Build and push
|
||||
if: ${{ github.event_name == 'schedule' && env.GH_CR_PAT != null }}
|
||||
|
|
9
.github/workflows/css-lint.yaml
vendored
9
.github/workflows/css-lint.yaml
vendored
|
@ -16,8 +16,15 @@ jobs:
|
|||
working-directory: ./web
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
- name: Check out pull request code
|
||||
uses: actions/checkout@v4
|
||||
if: github.event_name == 'pull_request'
|
||||
with:
|
||||
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
||||
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v4
|
||||
if: github.event_name == 'push'
|
||||
|
||||
- name: Get changed files
|
||||
id: changed-files-yaml
|
||||
|
|
|
@ -9,8 +9,15 @@ jobs:
|
|||
name: Generate API Documentation
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
- name: Check out pull request code
|
||||
uses: actions/checkout@v4
|
||||
if: github.event_name == 'pull_request'
|
||||
with:
|
||||
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
||||
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v4
|
||||
if: github.event_name == 'push'
|
||||
|
||||
- name: Run redoc on openapi.yaml
|
||||
run: |
|
||||
|
|
9
.github/workflows/hls-tests.yml
vendored
9
.github/workflows/hls-tests.yml
vendored
|
@ -25,8 +25,15 @@ jobs:
|
|||
with:
|
||||
concurrent_skipping: 'same_content_newer'
|
||||
|
||||
- name: Checkout repository
|
||||
- name: Check out pull request code
|
||||
uses: actions/checkout@v4
|
||||
if: github.event_name == 'pull_request'
|
||||
with:
|
||||
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
||||
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v4
|
||||
if: github.event_name == 'push'
|
||||
|
||||
- name: Get changed files
|
||||
id: changed-files-yaml
|
||||
|
|
31
.github/workflows/javascript-format-build.yml
vendored
31
.github/workflows/javascript-format-build.yml
vendored
|
@ -28,14 +28,15 @@ jobs:
|
|||
cancel_others: 'true'
|
||||
skip_after_successful_duplicate: 'true'
|
||||
|
||||
- name: Checkout
|
||||
- name: Check out pull request code
|
||||
uses: actions/checkout@v4
|
||||
if: github.event_name == 'pull_request'
|
||||
with:
|
||||
# Make sure the actual branch is checked out when running on pull requests
|
||||
ref: ${{ github.event.pull_request.head.ref }}
|
||||
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
||||
fetch-depth: 0
|
||||
persist-credentials: true
|
||||
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v4
|
||||
if: github.event_name == 'push'
|
||||
|
||||
- name: Get changed files
|
||||
id: changed-files-yaml
|
||||
|
@ -101,13 +102,15 @@ jobs:
|
|||
cancel_others: 'true'
|
||||
skip_after_successful_duplicate: 'true'
|
||||
|
||||
- name: Checkout
|
||||
- name: Check out pull request code
|
||||
uses: actions/checkout@v4
|
||||
if: github.event_name == 'pull_request'
|
||||
with:
|
||||
# Make sure the actual branch is checked out when running on pull requests
|
||||
ref: ${{ github.event.pull_request.head.ref }}
|
||||
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v4
|
||||
if: github.event_name == 'push'
|
||||
|
||||
- name: Cache node modules
|
||||
uses: actions/cache@v4
|
||||
|
@ -155,13 +158,15 @@ jobs:
|
|||
${{ runner.os }}-build-
|
||||
${{ runner.os }}-
|
||||
|
||||
- name: Checkout
|
||||
- name: Check out pull request code
|
||||
uses: actions/checkout@v4
|
||||
if: github.event_name == 'pull_request'
|
||||
with:
|
||||
# Make sure the actual branch is checked out when running on pull requests
|
||||
ref: ${{ github.event.pull_request.head.ref }}
|
||||
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v4
|
||||
if: github.event_name == 'push'
|
||||
|
||||
- name: Bundle web app (next.js build)
|
||||
run: build/web/bundleWeb.sh
|
||||
|
|
9
.github/workflows/javascript-tests.yml
vendored
9
.github/workflows/javascript-tests.yml
vendored
|
@ -17,8 +17,15 @@ jobs:
|
|||
with:
|
||||
concurrent_skipping: 'same_content_newer'
|
||||
|
||||
- name: Checkout
|
||||
- name: Check out pull request code
|
||||
uses: actions/checkout@v4
|
||||
if: github.event_name == 'pull_request'
|
||||
with:
|
||||
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
||||
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v4
|
||||
if: github.event_name == 'push'
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
|
|
11
.github/workflows/screenshots.yml
vendored
11
.github/workflows/screenshots.yml
vendored
|
@ -14,7 +14,16 @@ jobs:
|
|||
Screenshots:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Check out pull request code
|
||||
uses: actions/checkout@v4
|
||||
if: github.event_name == 'pull_request'
|
||||
with:
|
||||
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
||||
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v4
|
||||
if: github.event_name == 'push'
|
||||
|
||||
- uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: '1.22'
|
||||
|
|
10
.github/workflows/shellcheck.yml
vendored
10
.github/workflows/shellcheck.yml
vendored
|
@ -20,7 +20,15 @@ jobs:
|
|||
container:
|
||||
image: docker.io/ubuntu:24.04
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Check out pull request code
|
||||
uses: actions/checkout@v4
|
||||
if: github.event_name == 'pull_request'
|
||||
with:
|
||||
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
||||
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v4
|
||||
if: github.event_name == 'push'
|
||||
|
||||
- name: Install shellcheck
|
||||
run: apt update && apt install -y shellcheck bash && shellcheck --version
|
||||
|
|
Loading…
Reference in a new issue