Skip to content

Instantly share code, notes, and snippets.

View kodezaccounts's full-sized avatar

kodezaccounts

View GitHub Profile
trigger: none
stages:
- stage: Deploy
jobs:
- deployment: DeployToAzure
displayName: Deploy to Azure
pool:
vmImage: 'ubuntu-latest'
environment: 'Production'
on:
issue_comment:
types: [created, edited]
@kodezaccounts
kodezaccounts / gha-pull-request-closed-workflow-example.yaml
Created July 30, 2023 01:19
gha-pull-request-closed-workflow-example.yaml
name: Pull Request Closed Workflow
on:
pull_request:
types: [closed]
@kodezaccounts
kodezaccounts / pull-request-triggers-example.yaml
Created July 30, 2023 01:18
Pull request triggers with ADO
- task: PowerShell@2
inputs:
targetType: 'inline'
script: |
# Call REST API and set the result to $pr
$token = "{PAT}" # Replace it with your PAT
$token = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes(":$($token)"))
$url="https://dev.azure.com/{organization}/{project}/_apis/git/pullrequests/{pull request id}?api-version=7.1-preview.1" # Replace the {} with your information
$head = @{ Authorization =" Basic $token" }
$pr = Invoke-RestMethod -Uri $url -Method Get -Headers $head -ContentType application/json
@kodezaccounts
kodezaccounts / community-actions-example.yaml
Created July 30, 2023 01:16
community actions example
- name: Mark stale issues and pull requests
uses: actions/stale@v4
with:
days-before-stale: 60
days-before-close: 7
@kodezaccounts
kodezaccounts / kubernetes.yaml
Created July 30, 2023 01:14
Kubernetes Example
- name: Deploy to Kubernetes
uses: azure/k8s-deploy@v1
with:
namespace: mynamespace
manifests: |
manifest1.yml
manifest2.yml
images: |
myimage1:$(IMAGE1_NAME)
myimage2:$(IMAGE2_NAME)