diff --git a/.github/workflows/code-review.yml b/.github/workflows/code-review.yml index e49834851..9bba61e62 100644 --- a/.github/workflows/code-review.yml +++ b/.github/workflows/code-review.yml @@ -15,8 +15,8 @@ jobs: - uses: actions/create-github-app-token@v1 id: app-token with: - app-id: ${{ env.APP_ID }} - private-key: ${{ env.PRIVATE_KEY }} + app-id: ${{ secrets.NKDAGILITY_BOT_APP_ID }} + private-key: ${{ secrets.NKDAGILITY_BOT_CLIENTSECRET }} - uses: fitomad/github-chatgpt-integration@main with: openai-api-key: ${{ secrets.OPENAI_API_KEY }} diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 037896471..76fb00b04 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -7,7 +7,6 @@ permissions: on: push: branches: - - "*" tags: - '!v*-*' pull_request: @@ -19,10 +18,6 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true -env: - APP_ID: "Iv23li9aYvt0VW9x4Jhh" - PRIVATE_KEY: ${{ secrets.NKDAGILITY_BOT_CLIENTSECRET }} - defaults: run: shell: pwsh @@ -253,6 +248,9 @@ jobs: GitVersion_InformationalVersion: ${{ needs.Setup.outputs.GitVersion_InformationalVersion }} GitVersion_NuGetVersion: ${{ needs.Setup.outputs.GitVersion_NuGetVersion }} GitVersion_PreReleaseLabel: ${{ needs.Setup.outputs.GitVersion_PreReleaseLabel }} + HasChanged_src: ${{ needs.Setup.outputs.HasChanged_src }} + HasChanged_docs: ${{ needs.Setup.outputs.HasChanged_docs }} + HasChanged_automation: ${{ needs.Setup.outputs.HasChanged_automation }} needs: [build, Setup] if: ${{ success() && ( needs.Setup.outputs.nkdAgility_Ring != 'Canary' ) }} steps: @@ -262,8 +260,8 @@ jobs: - uses: actions/create-github-app-token@v1 id: app-token with: - app-id: ${{ env.APP_ID }} - private-key: ${{ env.PRIVATE_KEY }} + app-id: ${{ secrets.NKDAGILITY_BOT_APP_ID }} + private-key: ${{ secrets.NKDAGILITY_BOT_CLIENTSECRET }} - name: "Package Files" shell: pwsh run: | @@ -272,7 +270,7 @@ jobs: id: release-options shell: pwsh run: | - if ($Env:nkdAgility_Ring -ne 'Canary') { + if ($Env:nkdAgility_Ring -ne 'Canary' && ($Env:HasChanged_src || $Env:HasChanged_docs )) { echo "discussion_category_name=Anouncement" >> $env:GITHUB_OUTPUT } - name: Release @@ -357,7 +355,7 @@ jobs: Write-Output $"Running with {$chocoFile}" } - choco push $chocoFile.FullName --version $NuGetVersion --key ${{ secrets.CHOCO_APIKEY }} --source https://push.chocolatey.org/ + choco push "$chocoFile" --version $NuGetVersion --key ${{ secrets.CHOCO_APIKEY }} --source https://push.chocolatey.org/ # Release to Winget @@ -379,7 +377,7 @@ jobs: - name: "Winget Release" shell: pwsh run: | - .\build\releaseWingetPackage.ps1 -version ${{ needs.Setup.outputs.GitVersion_SemVer }} -ring ${{needs.Setup.outputs.nkdAgility_Ring}} -GH_TOKEN ${{ secrets.GITHUB_TOKEN }} + .\build\releaseWingetPackage.ps1 -version ${{ needs.Setup.outputs.GitVersion_SemVer }} -ring ${{needs.Setup.outputs.nkdAgility_Ring}} -GH_TOKEN ${{ secrets.NKD_MRHINSH_TOKEN }} # Release to Docs DocsRelease: diff --git a/.github/workflows/open-pr-describer.yml b/.github/workflows/open-pr-describer.yml new file mode 100644 index 000000000..5e5fa4e65 --- /dev/null +++ b/.github/workflows/open-pr-describer.yml @@ -0,0 +1,22 @@ +name: OpenAI PR Description Generator + +on: + pull_request: + types: + - opened + - synchronize + +permissions: + pull-requests: write + contents: read + +jobs: + pull-request: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: Ant0wan/openai-pr@v1 + with: + api-key: ${{ secrets.OPENAI_API_KEY }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/MigrationTools.sln b/MigrationTools.sln index 3852462fd..71c4a0e90 100644 --- a/MigrationTools.sln +++ b/MigrationTools.sln @@ -92,6 +92,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".workflows", ".workflows", ProjectSection(SolutionItems) = preProject .github\workflows\code-review.yml = .github\workflows\code-review.yml .github\workflows\main.yml = .github\workflows\main.yml + .github\workflows\open-pr-describer.yml = .github\workflows\open-pr-describer.yml .github\workflows\opencommit.yml = .github\workflows\opencommit.yml .github\workflows\stale.yml = .github\workflows\stale.yml EndProjectSection