Skip to content

feat: set default values #42

feat: set default values

feat: set default values #42

name: test-elastic-active-branches
on:
merge_group: ~
workflow_dispatch: ~
pull_request:
branches:
- main
paths:
- '.github/workflows/test-elastic-active-branches.yml'
- 'elastic/active-branches/**'
push:
branches:
- main
paths:
- '.github/workflows/test-elastic-active-branches.yml'
- 'elastic/active-branches/**'
permissions:
contents: read
jobs:
test:
needs:
- main
- exclude-main
- filter
runs-on: ubuntu-latest
steps:
- id: check
uses: elastic/oblt-actions/check-dependent-jobs@v1
with:
jobs: ${{ toJSON(needs) }}
- run: ${{ steps.check.outputs.is-success }}
main:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./elastic/active-branches
id: active-branches
- name: Verify main is in the active branches
if: ${{ !contains(fromJSON(steps.active-branches.outputs.branches), 'main') }}
run: echo "Main branch could not be found" && exit 1
exclude-main:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./elastic/active-branches
id: active-branches
with:
exclude-branches: main
- name: Verify main is not in the active branches
if: contains(fromJSON(steps.active-branches.outputs.branches), 'main')
run: echo "Main branch could be found but should be excluded" && exit 1
filter:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- uses: ./elastic/active-branches
id: active-branches
with:
filter-branches: true
- name: Verify main is in the active branches
if: ${{ !contains(fromJSON(steps.active-branches.outputs.branches), 'main') }}
run: echo "Main branch could not be found" && exit 1
- name: Verify 8.x is not in the active branches
if: ${{ contains(fromJSON(steps.active-branches.outputs.branches), '8.x') }}
run: echo "Main branch could not be found" && exit 1