Skip to content

Commit

Permalink
feat: Added FETCH_TOKEN for checkout
Browse files Browse the repository at this point in the history
  • Loading branch information
samtrion committed May 19, 2024
1 parent 81dfb9d commit 2cf17fb
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 3 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/ci-dotnet-fast.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ on:
solution:
required: true
type: string
secrets:
FETCH_TOKEN:
required: false

concurrency:
group: ${{ github.workflow_ref}}@${{ github.ref }}
Expand All @@ -37,6 +40,7 @@ jobs:
with:
fetch-depth: 0
submodules: recursive
token: ${{ secrets.FETCH_TOKEN || github.token }}

- name: Setup .NET
uses: actions/setup-dotnet@v4
Expand Down Expand Up @@ -67,5 +71,4 @@ jobs:
if: ${{ github.event_name == 'pull_request' && github.actor == 'dependabot[bot]' }}
uses: ./.github/workflows/step-dependabot-merge.yml
needs:
- build-and-test
secrets: inherit
- build-and-test
8 changes: 7 additions & 1 deletion .github/workflows/cicd-dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ on:
solution:
required: true
type: string
secrets:
FETCH_TOKEN:
required: false

concurrency:
group: ${{ github.workflow_ref }}@${{ github.ref }}
Expand All @@ -65,6 +68,7 @@ jobs:
with:
dotnet-version: ${{ inputs.dotnet-version || '8.x' }}
dotnet-quality: ${{ inputs.dotnet-quality || 'ga' }}
secrets: inherit

format:
name: Format
Expand All @@ -76,6 +80,7 @@ jobs:
dotnet-quality: ${{ inputs.dotnet-quality || 'ga' }}
runs-on: ${{ inputs.runs-on-build || 'ubuntu-latest' }}
solution: ${{ inputs.solution }}
secrets: inherit

codeql:
name: CodeQL
Expand All @@ -87,6 +92,7 @@ jobs:
dotnet-quality: ${{ inputs.dotnet-quality || 'ga' }}
runs-on: ${{ inputs.runs-on-build || 'ubuntu-latest' }}
solution: ${{ inputs.solution }}
secrets: inherit

tests:
name: Tests
Expand Down Expand Up @@ -148,4 +154,4 @@ jobs:
with:
runs-on: ${{ inputs.runs-on-tests || 'ubuntu-latest' }}
solution-version: ${{ needs.version.outputs.solution-version }}

secrets: inherit
4 changes: 4 additions & 0 deletions .github/workflows/step-dotnet-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ on:
solution:
required: true
type: string
secrets:
FETCH_TOKEN:
required: false

jobs:
build:
Expand All @@ -32,6 +35,7 @@ jobs:
with:
fetch-depth: 0
submodules: recursive
token: ${{ secrets.FETCH_TOKEN || github.token }}

- name: Setup .NET
uses: actions/setup-dotnet@v4
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/step-dotnet-codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ on:
solution:
required: true
type: string
secrets:
FETCH_TOKEN:
required: false

defaults:
run:
Expand All @@ -40,6 +43,7 @@ jobs:
with:
fetch-depth: 0
submodules: recursive
token: ${{ secrets.FETCH_TOKEN || github.token }}

- name: Install .NET ${{ inputs.dotnet-version }}
uses: actions/setup-dotnet@v4
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/step-dotnet-draft-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ on:
solution-version:
required: true
type: string
secrets:
FETCH_TOKEN:
required: false

jobs:
draft-release:
Expand All @@ -21,6 +24,7 @@ jobs:
with:
fetch-depth: 0
submodules: recursive
token: ${{ secrets.FETCH_TOKEN || github.token }}

- name: Release Drafter
uses: release-drafter/[email protected]
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/step-dotnet-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ on:
solution:
required: true
type: string
secrets:
FETCH_TOKEN:
required: false

defaults:
run:
Expand All @@ -36,6 +39,7 @@ jobs:
with:
fetch-depth: 0
submodules: recursive
token: ${{ secrets.FETCH_TOKEN || github.token }}

- name: Setup .NET
uses: actions/setup-dotnet@v4
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/step-dotnet-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ on:
required: false
SONAR_TOKEN:
required: false
FETCH_TOKEN:
required: false

jobs:
pretest:
Expand Down Expand Up @@ -75,6 +77,7 @@ jobs:
with:
fetch-depth: 0
submodules: recursive
token: ${{ secrets.FETCH_TOKEN || github.token }}

- name: Setup .NET
uses: actions/setup-dotnet@v4
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/step-dotnet-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ on:
required: false
type: string
default: ubuntu-latest
secrets:
FETCH_TOKEN:
required: false
outputs:
solution-version:
description: 'The FullSemVer version'
Expand All @@ -32,6 +35,7 @@ jobs:
with:
fetch-depth: 0
submodules: recursive
token: ${{ secrets.FETCH_TOKEN || github.token }}

- name: Setup .NET
uses: actions/setup-dotnet@v4
Expand Down

0 comments on commit 2cf17fb

Please sign in to comment.