chore(deps): update kinsondigital/infrastructure action to v12 #95
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }}"; |