Skip to content

Test PR opened

Test PR opened #94

name: Test PR opened
on:
workflow_dispatch: {}
## Added pull_request to register workflow from the PR.
## Read more https://stackoverflow.com/questions/63362126/github-actions-how-to-run-a-workflow-created-on-a-non-master-branch-from-the-wo
# pull_request: {}
jobs:
setup:
runs-on: ubuntu-latest
steps:
- name: Setup
run: echo "Do setup"
test:
runs-on: ubuntu-latest
needs: [setup]
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: ./
id: current
with:
env-label: |
preview: deploy
qa1: deploy/qa1
qa2: deploy/qa2
qa3: deploy/qa3
qa4: deploy/qa4
labels: '["deploy","deploy/qa2"]'
open: 'true'
- uses: nick-fields/assert-action@v2
with:
expected: '["preview","qa2"]'
actual: ${{ steps.current.outputs.deploy_envs }}
- uses: nick-fields/assert-action@v2
with:
expected: '["qa1","qa3","qa4"]'
actual: ${{ steps.current.outputs.destroy_envs }}
teardown:
runs-on: ubuntu-latest
needs: [test]
if: ${{ always() }}
steps:
- name: Tear down
run: echo "Do Tear down"