diff --git a/.github/workflows/add-new-issue-to-project.yml b/.github/workflows/add-new-issue-to-project.yml index aef1116..a13646c 100644 --- a/.github/workflows/add-new-issue-to-project.yml +++ b/.github/workflows/add-new-issue-to-project.yml @@ -4,7 +4,7 @@ name: 🤖Add New Issue To Project on: issues: types: opened - pull_request: + pull_request_target: types: opened branches: [main, preview] @@ -12,7 +12,7 @@ on: jobs: add_new_issue_to_project: name: Add New Issue - uses: KinsonDigital/Infrastructure/.github/workflows/add-issue-to-project.yml@v11.0.0 + uses: KinsonDigital/Infrastructure/.github/workflows/add-issue-to-project.yml@v13.0.0 with: org-name: "${{ vars.ORGANIZATION_NAME }}" org-project-name: "${{ vars.ORG_PROJECT_NAME }}" diff --git a/.github/workflows/build-status-check.yml b/.github/workflows/build-status-check.yml index 4038ab6..face44b 100644 --- a/.github/workflows/build-status-check.yml +++ b/.github/workflows/build-status-check.yml @@ -3,14 +3,14 @@ run-name: ✅Build Status Check (${{ github.base_ref }} branch) on: - pull_request: + pull_request_target: branches: [main, preview] jobs: build_project: name: ${{ vars.PROJECT_NAME }} Build Status Check - uses: KinsonDigital/Infrastructure/.github/workflows/build-csharp-project.yml@v11.0.0 + uses: KinsonDigital/Infrastructure/.github/workflows/build-csharp-project.yml@v13.0.0 with: project-name: ${{ vars.PROJECT_NAME }} build-config: Debug diff --git a/.github/workflows/prepare-release.yml b/.github/workflows/prepare-release.yml index 47dc6ae..632b879 100644 --- a/.github/workflows/prepare-release.yml +++ b/.github/workflows/prepare-release.yml @@ -73,7 +73,7 @@ jobs: prepare_release: name: Prepare ${{ inputs.release-type }} Release Of ${{ vars.PROJECT_NAME }} needs: print_validate_workflow - uses: KinsonDigital/Infrastructure/.github/workflows/prepare-release.yml@v11.0.0 + uses: KinsonDigital/Infrastructure/.github/workflows/prepare-release.yml@v13.0.0 with: project-name: ${{ vars.PROJECT_NAME }} release-type: ${{ inputs.release-type }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3f20f38..d0515a7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -48,7 +48,7 @@ jobs: perform_release: name: Performing ${{ inputs.release-type }} Release of ${{ vars.PROJECT_NAME }} (${{ inputs.release-type == 'Production' && 'Release' || 'Debug' }}) needs: determine_release_notes_path - uses: KinsonDigital/Infrastructure/.github/workflows/dotnet-action-release.yml@v11.0.0 + uses: KinsonDigital/Infrastructure/.github/workflows/dotnet-action-release.yml@v13.0.0 with: project-name: "${{ vars.PROJECT_NAME }}" release-type: "${{ inputs.release-type }}" diff --git a/.github/workflows/sync-bot.yml b/.github/workflows/sync-bot.yml index 91f2d04..b4aa2a5 100644 --- a/.github/workflows/sync-bot.yml +++ b/.github/workflows/sync-bot.yml @@ -20,7 +20,7 @@ jobs: - name: Set Up Deno uses: denoland/setup-deno@v1 with: - deno-version: v1.x + deno-version: ${{ vars.DENO_VERSION }} - name: Run Sync Bot (Issue Change) run: | diff --git a/.github/workflows/sync-issue-to-pr.yml b/.github/workflows/sync-issue-to-pr.yml deleted file mode 100644 index dc2ace5..0000000 --- a/.github/workflows/sync-issue-to-pr.yml +++ /dev/null @@ -1,55 +0,0 @@ -name: 🔄️Sync Issue To PR - - -defaults: - run: - shell: pwsh - - -on: - pull_request: - types: opened - issue_comment: # This event is triggered when creating issue and pr comments - types: created - - -jobs: - sync_issue_to_pr: - name: Start Sync Process - if: | - (github.event_name == 'issue_comment' && contains(github.event.comment.body, '[run-sync]')) || - github.event_name == 'pull_request' && startsWith(github.head_ref, 'feature/') - runs-on: ubuntu-latest - steps: - - name: Set Up Deno - uses: denoland/setup-deno@v1 - with: - deno-version: v1.x - - - name: Sync - run: | - $eventName = "${{ github.event_name }}"; - $scriptUrl = "${{ vars.SCRIPT_BASE_URL }}/${{ vars.CICD_SCRIPTS_VERSION }}/${{ vars.SCRIPT_RELATIVE_DIR_PATH }}/sync-issue-to-pr.ts"; - $issueOrPrNumber = $eventName -eq "pull_request" ? "${{ github.event.number }}" : "${{ github.event.issue.number }}"; - - Write-Host "::notice::Event Type: $eventName"; - Write-Host "::notice::Organization Name: ${{ vars.ORGANIZATION_NAME }}"; - Write-Host "::notice::Project Name: ${{ vars.PROJECT_NAME }}"; - Write-Host "::notice::Requested By: ${{ github.event.sender.login }}"; - Write-Host "::notice::PR Number: $issueOrPrNumber"; - - <# Deno Args: - 1. Organization name - 2. Project name - 3. Triggered by user - 4. Issue or pull request number - 5. PAT - #> - deno run ` - --allow-net ` - "$scriptUrl" ` - "${{ vars.ORGANIZATION_NAME }}" ` - "${{ vars.PROJECT_NAME }}" ` - "${{ github.event.sender.login }}" ` - "$issueOrPrNumber" ` - "${{ secrets.CICD_TOKEN }}"; diff --git a/.github/workflows/sync-pr-to-issue.yml b/.github/workflows/sync-pr-to-issue.yml new file mode 100644 index 0000000..636015f --- /dev/null +++ b/.github/workflows/sync-pr-to-issue.yml @@ -0,0 +1,39 @@ +name: 🔄️Sync PR To Issue + + +defaults: + run: + shell: pwsh + + +on: + pull_request_target: + types: opened + issue_comment: # This event is triggered when creating issue and pr comments + types: created + + +jobs: + initial_sync: + name: Start Initial Sync + if: ${{ github.event_name == 'pull_request_target' }} + uses: KinsonDigital/Infrastructure/.github/workflows/initial-manual-sync.yml@v13.0.0 + with: + issue-or-pr-number: ${{ github.event.pull_request.number }} + sync-type: initial + requested-by: ${{ github.event.sender.login }} + branch: ${{ github.event.pull_request.head.ref }} # Input not required for initial sync + secrets: + cicd-pat: ${{ secrets.CICD_TOKEN }} + + + manual_sync: + name: Start Manual Sync + if: ${{ github.event_name == 'issue_comment' && contains(github.event.comment.body, '[run-sync]') }} + uses: KinsonDigital/Infrastructure/.github/workflows/initial-manual-sync.yml@v13.0.0 + with: + issue-or-pr-number: ${{ github.event.issue.number }} + sync-type: manual + requested-by: "validate:${{ github.event.sender.login }}" + secrets: + cicd-pat: ${{ secrets.CICD_TOKEN }} diff --git a/.github/workflows/sync-status-check.yml b/.github/workflows/sync-status-check.yml index e1e85c7..2e7bad5 100644 --- a/.github/workflows/sync-status-check.yml +++ b/.github/workflows/sync-status-check.yml @@ -7,7 +7,7 @@ defaults: on: - pull_request: + pull_request_target: branches: [main, preview] @@ -20,7 +20,7 @@ jobs: - name: Set Up Deno uses: denoland/setup-deno@v1 with: - deno-version: v1.x + deno-version: ${{ vars.DENO_VERSION }} - name: Run Sync Status Check run: | diff --git a/.github/workflows/unit-test-status-check.yml b/.github/workflows/unit-test-status-check.yml index c271341..41bc57b 100644 --- a/.github/workflows/unit-test-status-check.yml +++ b/.github/workflows/unit-test-status-check.yml @@ -3,14 +3,14 @@ run-name: ✅Unit Testing Status Check (${{ github.base_ref }} branch) on: - pull_request: + pull_request_target: branches: [main, preview] jobs: run_tests: name: ${{ vars.PROJECT_NAME }} Test Status Check - uses: KinsonDigital/Infrastructure/.github/workflows/run-csharp-tests.yml@v11.0.0 + uses: KinsonDigital/Infrastructure/.github/workflows/run-csharp-tests.yml@v13.0.0 with: project-name: ${{ vars.PROJECT_NAME }}Tests build-config: Debug