Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🔧 (main.yml): update workflow conditions and verbosity for improved C… #2442

Merged
merged 3 commits into from
Oct 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 3 additions & 35 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ on:
branches: ["main"]
tags-ignore: ["v*-*"]
pull_request_target:
types: [opened, synchronize, labeled]
branches: ["main"]
workflow_dispatch:
inputs:
Expand All @@ -35,7 +34,7 @@ jobs:
if: ${{ (github.event_name == 'push') ||
(github.event_name == 'workflow_dispatch') ||
(github.event_name == 'pull_request_target' &&
(github.event.pull_request.head.repo.full_name == github.repository || contains(github.event.pull_request.labels.*.name, 'safe-to-build')))
(github.event.pull_request.head.repo.full_name == github.repository || contains(github.event.pull_request.labels.*.name, 'safe')))
}}
runs-on: ubuntu-latest
outputs:
Expand All @@ -60,22 +59,9 @@ jobs:
nkdAgility_RunRelease: ${{ steps.nkdagility.outputs.RunRelease }}
nkdAgility_AzureSitesEnvironment: ${{ steps.nkdagility.outputs.AzureSitesEnvironment }}
steps:
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ secrets.NKDAGILITY_BOT_APP_ID }}
private-key: ${{ secrets.NKDAGILITY_BOT_CLIENTSECRET }}
- name: Remove "safe" label from PR
if: ${{ github.event.pull_request.head.repo.full_name != github.repository }}
uses: actions-ecosystem/action-remove-labels@v1
with:
token: ${{ steps.app-token.outputs.token }}
labels: safe-to-build
- name: Checkout
uses: actions/checkout@v4
with:
repository: ${{ github.event_name == 'push' && github.repository || github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event_name == 'push' && github.ref || github.event.pull_request.head.ref }}
fetch-depth: 0
- name: Install GitVersion
uses: gittools/actions/gitversion/[email protected]
Expand All @@ -87,7 +73,6 @@ jobs:
uses: gittools/actions/gitversion/[email protected]
with:
useConfigFile: true

- uses: dorny/paths-filter@v3
id: filter
with:
Expand All @@ -99,12 +84,9 @@ jobs:
automation:
- 'build/**'
- '.github/workflows/**'

- name: "Build NKDAgility Outputs"
shell: pwsh
id: nkdagility
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
run: |
# Get Branch Name
Write-Output "::group::Get Branch Name"
Expand Down Expand Up @@ -236,14 +218,6 @@ jobs:
- HasChanged_src: ${{needs.Setup.outputs.HasChanged_src}}
- HasChanged_docs: ${{needs.Setup.outputs.HasChanged_docs}}
- HasChanged_automation: ${{needs.Setup.outputs.HasChanged_automation}}
### Github Bits
- repository: ${{ github.event_name == 'push' && github.repository || github.event.pull_request.head.repo.full_name }}
- ref: ${{ github.event_name == 'push' && github.ref || github.event.pull_request.head.ref }}
- github.repository: ${{github.repository}}
- github.event.pull_request.head.repo.full_name: ${{github.event.pull_request.head.repo.full_name}}
- github.ref: ${{github.ref}}
- github.event.pull_request.head.ref: ${{github.event.pull_request.head.ref}}

"@
echo $markdown >> $Env:GITHUB_STEP_SUMMARY
- name: "Show Release Description"
Expand All @@ -264,7 +238,7 @@ jobs:
name: "Build, Test, Sonar Cloud Analysis, & Package"
runs-on: windows-latest
needs: Setup
if: false # ${{ success() }}
if: ${{ success() }}
env:
solution: '**/*.sln'
buildPlatform: 'Any CPU'
Expand All @@ -285,9 +259,6 @@ jobs:
distribution: 'zulu'
- name: Checkout
uses: actions/checkout@v4
with:
repository: ${{ github.event_name == 'push' && github.repository || github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event_name == 'push' && github.ref || github.event.pull_request.head.ref }}
- uses: cschleiden/replace-tokens@v1
with:
files: '["**/StaticVariables.cs"]'
Expand Down Expand Up @@ -360,17 +331,14 @@ jobs:
BuildDocs:
name: "Build Documentation output"
runs-on: ubuntu-latest
if: false # ${{ success() }}
if: ${{ success() }}
needs: [Setup]
env:
GitVersion_SemVer: ${{ needs.Setup.outputs.GitVersion_SemVer }}
GitVersion_AssemblySemVer: ${{ needs.Setup.outputs.GitVersion_AssemblySemVer }}
GitVersion_InformationalVersion: ${{ needs.Setup.outputs.GitVersion_InformationalVersion }}
steps:
- uses: actions/checkout@v4
with:
repository: ${{ github.event_name == 'push' && github.repository || github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event_name == 'push' && github.ref || github.event.pull_request.head.ref }}
- name: Setup Ruby
uses: ruby/setup-ruby@8575951200e472d5f2d95c625da0c7bec8217c42 # v1.161.0
with:
Expand Down
Loading