Skip to content

Commit

Permalink
Adding a GH action to trigger when PR is merged
Browse files Browse the repository at this point in the history
  • Loading branch information
BobJWalker committed Jun 13, 2024
1 parent 6209dac commit 125d2a7
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/pr_merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: PR Closed

on:
pull_request:
types: [closed]
branches:
- 'features/**'
workflow_dispatch:

env:
OCTOPUS_PROJECT_NAME: "Trident"
OCTOPUS_RUNBOOK_NAME: "Destroy Application Infrastructure"
OCTOPUS_ENVIRONMENT_NAME: "Development"
OCTOPUS_SPACE: Default
OCTOPUS_API_KEY: ${{ secrets.OCTOPUSSERVERAPIKEY }}
OCTOPUS_URL: http://bobjwalker.octopus.app
jobs:
destroy-feature-branch:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: run destroy infrastructure runbook
uses: OctopusDeploy/run-runbook-action@v3
with:
project: ${{ env.OCTOPUS_PROJECT_NAME }}
runbook: "${{ env.OCTOPUS_RUNBOOK_NAME }}"
environments: "${{ env.OCTOPUS_ENVIRONMENT_NAME }}"
variables: |
- 'Project.Release.Branch.Name:${{ github.head_ref }}'

0 comments on commit 125d2a7

Please sign in to comment.