Skip to content

Validate Policies

Validate Policies #309

Workflow file for this run

name: Validate Policies
on:
merge_group:
workflow_dispatch:
inputs:
run-e2e-tests:
description: 'Run e2e tests (only from main branch by default)'
required: false
default: false
type: boolean
pull_request:
branches: [main]
push:
branches: [main]
permissions:
contents: read
jobs:
validate:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Setup updatecli
uses: elastic/oblt-actions/updatecli/install@v1
with:
version-file: .tool-versions
- name: Setup releasepost
uses: updatecli/releasepost-action@864390bddae97db06ee881ab4a08d159b4464643 # v0.5.0
- name: Validate
run: make test
- name: Get token from GitHub App
id: generate_testing_token
uses: actions/create-github-app-token@v2
# Only run e2e tests from the main branch as we need some credentials
# that we don't want to risk leaking from pullrequest opened by random contributors
if: github.ref == 'refs/heads/main' || ( github.event_name == 'workflow_dispatch' && inputs.run-e2e-tests == true )
with:
app-id: ${{ secrets.ELASTIC_OBSERVABILITY_APP_ID }}
private-key: ${{ secrets.ELASTIC_OBSERVABILITY_APP_PEM }}
owner: ${{ github.repository_owner }}
- name: e2e tests
# Only run e2e tests from the main branch as we need some credentials
# that we don't want to risk leaking from pullrequest opened by random contributors
if: github.ref == 'refs/heads/main' || ( github.event_name == 'workflow_dispatch' && inputs.run-e2e-tests == true )
run: make e2e-test
env:
GITHUB_TOKEN: ${{ steps.generate_testing_token.outputs.token }}
RELEASEPOST_GITHUB_TOKEN: ${{ steps.generate_testing_token.outputs.token }}