Skip to content

Commit

Permalink
[Dependencies] - Update .github/workflows/pr-lint.yml to match the te…
Browse files Browse the repository at this point in the history
…mplate repo
  • Loading branch information
credfeto committed Oct 26, 2023
1 parent 5ebb6a5 commit 469a507
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions .github/workflows/pr-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ env:
BASE_REF: ${{github.base_ref}}
jobs:
info:
if: ${{endsWith(github.repository, '-template')}}
if: endsWith(github.repository, '-template')
runs-on: ubuntu-latest
steps:
- name: "Initialise Workspace"
Expand All @@ -43,9 +43,9 @@ jobs:
# with:
# fetch-depth: 0
# - if: |-
# ${{!endsWith(github.repository, '-template')
# !endsWith(github.repository, '-template')
# && !startsWith(github.head_ref, 'release/')
# && !startsWith(github.head_ref, 'hotfix/')}}
# && !startsWith(github.head_ref, 'hotfix/')
# uses: seferov/pr-lint-action@v1.2.0
# with:
# title-regex: '^\[FF\-\d*?\](:)?(\ )'
Expand All @@ -58,14 +58,14 @@ jobs:
- name: "Initialise Workspace"
shell: bash
run: sudo chown -R "$USER:$USER" "$GITHUB_WORKSPACE"
- if: ${{(github.actor != 'dependabot[bot]' && !endsWith(github.repository , '-template'))}}
- if: (github.actor != 'dependabot[bot]' && !endsWith(github.repository , '-template'))
uses: actions/checkout@v4
with:
fetch-depth: 0
- if: ${{(github.actor != 'dependabot[bot]' && !endsWith(github.repository , '-template'))}}
- if: (github.actor != 'dependabot[bot]' && !endsWith(github.repository , '-template'))
shell: bash
run: echo "CHANGES=$(git diff --exit-code --no-patch --merge-base origin/main CHANGELOG.md 2> /dev/null && echo 0 || echo $?)" >> "$GITHUB_ENV"
- if: ${{(github.actor != 'dependabot[bot]' && !endsWith(github.repository , '-template')) && env.CHANGES == '0'}}
- if: (github.actor != 'dependabot[bot]' && !endsWith(github.repository , '-template')) && env.CHANGES == '0'
uses: actions/github-script@v6.4.1
with:
script: |
Expand All @@ -84,13 +84,13 @@ jobs:
with:
fetch-depth: 0
- name: "Get version from global.json"
if: ${{(github.actor != 'dependabot[bot]' && !endsWith(github.repository , '-template'))}}
if: (github.actor != 'dependabot[bot]' && !endsWith(github.repository , '-template'))
uses: credfeto/action-dotnet-version-detect@v1.3.0
with:
file: src/global.json
fallback: 7.0.*
- name: "Install dotnet"
if: ${{(github.actor != 'dependabot[bot]' && !endsWith(github.repository , '-template'))}}
if: (github.actor != 'dependabot[bot]' && !endsWith(github.repository , '-template'))
uses: actions/setup-dotnet@v3.2.0
env:
GITHUB_TOKEN: ${{secrets.SOURCE_PUSH_TOKEN}}
Expand All @@ -108,7 +108,7 @@ jobs:
7.0.*
${{env.DOTNET_VERSION}}
- name: "Enable dotnet tools"
if: ${{(github.actor != 'dependabot[bot]' && !endsWith(github.repository , '-template'))}}
if: (github.actor != 'dependabot[bot]' && !endsWith(github.repository , '-template'))
shell: bash
run: dotnet new tool-manifest
env:
Expand All @@ -121,7 +121,7 @@ jobs:
DOTNET_TC_QuickJitForLoops: "1"
DOTNET_TieredPGO: "1"
- name: "Install Changelog tool"
if: ${{(github.actor != 'dependabot[bot]' && !endsWith(github.repository , '-template'))}}
if: (github.actor != 'dependabot[bot]' && !endsWith(github.repository , '-template'))
shell: bash
run: dotnet tool install --local Credfeto.ChangeLog.Cmd
env:
Expand All @@ -134,7 +134,7 @@ jobs:
DOTNET_TC_QuickJitForLoops: "1"
DOTNET_TieredPGO: "1"
- name: "Check Changelog"
if: ${{(github.actor != 'dependabot[bot]' && !endsWith(github.repository , '-template'))}}
if: (github.actor != 'dependabot[bot]' && !endsWith(github.repository , '-template'))
shell: bash
run: dotnet changelog --changelog CHANGELOG.md --check-insert "origin/${{github.base_ref}}"
env:
Expand Down Expand Up @@ -227,12 +227,12 @@ jobs:
# optional parameter defaults to the current user
token: ${{github.token}}
- name: "Checkout Source"
if: ${{steps.visibility.outputs.is_public == 'true'}}
if: steps.visibility.outputs.is_public == 'true'
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: 'Dependency Review'
if: ${{steps.visibility.outputs.is_public == 'true'}}
if: steps.visibility.outputs.is_public == 'true'
uses: actions/dependency-review-action@v3.1.0

no-merge-commits:
Expand All @@ -251,7 +251,9 @@ jobs:
uses: greenled/no-merge-commits-check@v1.0.1

lint-code:
if: ${{github.event.pull_request.draft == false && ( !startsWith(github.head_ref, 'release/') && !startsWith(github.head_ref, 'hotfix/') )}}
if: |-
github.event.pull_request.draft == false &&
( !startsWith(github.head_ref, 'release/') && !startsWith(github.head_ref, 'hotfix/') )
runs-on: ubuntu-latest
steps:
- name: "Initialise Workspace"
Expand Down

0 comments on commit 469a507

Please sign in to comment.