mirror of
https://github.com/owncast/owncast.git
synced 2024-11-22 12:49:37 +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
|
name: GitHub actions
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
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
|
- uses: docker://rhysd/actionlint:latest
|
||||||
with:
|
with:
|
||||||
|
|
|
@ -18,8 +18,15 @@ jobs:
|
||||||
with:
|
with:
|
||||||
concurrent_skipping: 'same_content_newer'
|
concurrent_skipping: 'same_content_newer'
|
||||||
|
|
||||||
- name: Checkout repository
|
- name: Check out pull request code
|
||||||
uses: actions/checkout@v4
|
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
|
- name: Get changed files
|
||||||
id: changed-files-yaml
|
id: changed-files-yaml
|
||||||
|
|
9
.github/workflows/browser-testing.yml
vendored
9
.github/workflows/browser-testing.yml
vendored
|
@ -19,8 +19,15 @@ jobs:
|
||||||
with:
|
with:
|
||||||
concurrent_skipping: 'same_content_newer'
|
concurrent_skipping: 'same_content_newer'
|
||||||
|
|
||||||
- name: Checkout
|
- name: Check out pull request code
|
||||||
uses: actions/checkout@v4
|
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
|
- uses: actions/setup-node@v4
|
||||||
with:
|
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'
|
if: github.repository == 'owncast/owncast'
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Check out pull request code
|
||||||
uses: actions/checkout@v4
|
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
|
- name: Cache node modules
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
|
|
10
.github/workflows/chromatic.yml
vendored
10
.github/workflows/chromatic.yml
vendored
|
@ -28,13 +28,15 @@ jobs:
|
||||||
with:
|
with:
|
||||||
concurrent_skipping: 'same_content_newer'
|
concurrent_skipping: 'same_content_newer'
|
||||||
|
|
||||||
- name: Check out code
|
- name: Check out pull request code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
if: github.event_name == 'pull_request'
|
||||||
with:
|
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 }}
|
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
|
- name: Get changed files
|
||||||
id: changed-files-yaml
|
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
|
# 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:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Check out pull request code
|
||||||
uses: actions/checkout@v4
|
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
|
- uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
|
|
10
.github/workflows/container-lint.yml
vendored
10
.github/workflows/container-lint.yml
vendored
|
@ -19,7 +19,15 @@ jobs:
|
||||||
container:
|
container:
|
||||||
image: aquasec/trivy
|
image: aquasec/trivy
|
||||||
steps:
|
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
|
- name: Check critical issues
|
||||||
run: trivy config --exit-code 1 --severity "HIGH,CRITICAL" ./Dockerfile
|
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
|
image: tonistiigi/binfmt:latest
|
||||||
platforms: all
|
platforms: all
|
||||||
|
|
||||||
- name: Checkout repo
|
- name: Check out pull request code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
if: github.event_name == 'pull_request'
|
||||||
with:
|
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
|
- name: Build and push
|
||||||
if: ${{ github.event_name == 'schedule' && env.GH_CR_PAT != null }}
|
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
|
working-directory: ./web
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Check out pull request code
|
||||||
uses: actions/checkout@v4
|
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
|
- name: Get changed files
|
||||||
id: changed-files-yaml
|
id: changed-files-yaml
|
||||||
|
|
|
@ -9,8 +9,15 @@ jobs:
|
||||||
name: Generate API Documentation
|
name: Generate API Documentation
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Check out pull request code
|
||||||
uses: actions/checkout@v4
|
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
|
- name: Run redoc on openapi.yaml
|
||||||
run: |
|
run: |
|
||||||
|
|
9
.github/workflows/hls-tests.yml
vendored
9
.github/workflows/hls-tests.yml
vendored
|
@ -25,8 +25,15 @@ jobs:
|
||||||
with:
|
with:
|
||||||
concurrent_skipping: 'same_content_newer'
|
concurrent_skipping: 'same_content_newer'
|
||||||
|
|
||||||
- name: Checkout repository
|
- name: Check out pull request code
|
||||||
uses: actions/checkout@v4
|
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
|
- name: Get changed files
|
||||||
id: changed-files-yaml
|
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'
|
cancel_others: 'true'
|
||||||
skip_after_successful_duplicate: 'true'
|
skip_after_successful_duplicate: 'true'
|
||||||
|
|
||||||
- name: Checkout
|
- name: Check out pull request code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
if: github.event_name == 'pull_request'
|
||||||
with:
|
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 }}
|
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
|
- name: Get changed files
|
||||||
id: changed-files-yaml
|
id: changed-files-yaml
|
||||||
|
@ -101,13 +102,15 @@ jobs:
|
||||||
cancel_others: 'true'
|
cancel_others: 'true'
|
||||||
skip_after_successful_duplicate: 'true'
|
skip_after_successful_duplicate: 'true'
|
||||||
|
|
||||||
- name: Checkout
|
- name: Check out pull request code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
if: github.event_name == 'pull_request'
|
||||||
with:
|
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 }}
|
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
|
- name: Cache node modules
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
|
@ -155,13 +158,15 @@ jobs:
|
||||||
${{ runner.os }}-build-
|
${{ runner.os }}-build-
|
||||||
${{ runner.os }}-
|
${{ runner.os }}-
|
||||||
|
|
||||||
- name: Checkout
|
- name: Check out pull request code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
if: github.event_name == 'pull_request'
|
||||||
with:
|
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 }}
|
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)
|
- name: Bundle web app (next.js build)
|
||||||
run: build/web/bundleWeb.sh
|
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:
|
with:
|
||||||
concurrent_skipping: 'same_content_newer'
|
concurrent_skipping: 'same_content_newer'
|
||||||
|
|
||||||
- name: Checkout
|
- name: Check out pull request code
|
||||||
uses: actions/checkout@v4
|
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
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
|
|
11
.github/workflows/screenshots.yml
vendored
11
.github/workflows/screenshots.yml
vendored
|
@ -14,7 +14,16 @@ jobs:
|
||||||
Screenshots:
|
Screenshots:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
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
|
- uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version: '1.22'
|
go-version: '1.22'
|
||||||
|
|
10
.github/workflows/shellcheck.yml
vendored
10
.github/workflows/shellcheck.yml
vendored
|
@ -20,7 +20,15 @@ jobs:
|
||||||
container:
|
container:
|
||||||
image: docker.io/ubuntu:24.04
|
image: docker.io/ubuntu:24.04
|
||||||
steps:
|
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
|
- name: Install shellcheck
|
||||||
run: apt update && apt install -y shellcheck bash && shellcheck --version
|
run: apt update && apt install -y shellcheck bash && shellcheck --version
|
||||||
|
|
Loading…
Reference in a new issue