[Fleet] only auto-install content packages newer than the installed version #322097
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Trigger flaky test runner on comment | |
| on: | |
| issue_comment: | |
| types: | |
| - created | |
| jobs: | |
| trigger_flaky: | |
| name: Trigger flaky test runner on /flaky comment | |
| if: | | |
| github.event.issue.pull_request | |
| && ( | |
| contains(fromJSON('["MEMBER","OWNER"]'), github.event.comment.author_association) | |
| || github.event.comment.user.login == 'kibanamachine' | |
| ) | |
| && startsWith(github.event.comment.body, '/flaky ') | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout kibana-operations | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| repository: 'elastic/kibana-operations' | |
| ref: main | |
| path: ./kibana-operations | |
| token: ${{secrets.KIBANAMACHINE_TOKEN}} | |
| persist-credentials: false | |
| - name: Trigger flaky test runner | |
| working-directory: ./kibana-operations/triage | |
| env: | |
| GITHUB_TOKEN: ${{secrets.KIBANAMACHINE_TOKEN}} | |
| BUILDKITE_TOKEN: ${{secrets.OPS_BUILDKITE_TOKEN}} | |
| COMMENT_BODY: ${{github.event.comment.body}} | |
| ISSUE_NUMBER: ${{github.event.issue.number}} | |
| run: | | |
| # Match `/flaky` and capture only the config list. Tokens are | |
| # `type:path[:count]` and never span lines, so the match stops before any | |
| # footer, markers, trailing CR, or prose the comment carries below the | |
| # command — validating and extracting the configs in one step. | |
| # Pattern: type:path[:count] where path cannot contain .., start with ./ or /, or end with / | |
| config_token='(ftrConfig|scoutConfig|config):[a-zA-Z0-9_-]+([/.][a-zA-Z0-9_-]+)*(:[0-9]+)?' | |
| if [[ ! "$COMMENT_BODY" =~ ^/flaky[[:blank:]]+(${config_token}([[:blank:]]+${config_token})*) ]]; then | |
| echo "::error::Invalid comment format. Use: /flaky <type>:<config>[:count] [<type>:<config>[:count] ...]" | |
| echo "::error::Where <type> is one of: ftrConfig, scoutConfig, config" | |
| echo "::error::And <count> is an optional positive integer" | |
| echo "::error::Path cannot contain .., start with ./ or /, or end with /" | |
| echo "::error::Example: /flaky config:x-pack/test:5 ftrConfig:functional/apps" | |
| exit 1 | |
| fi | |
| configs="${BASH_REMATCH[1]}" | |
| npm ci --omit=dev | |
| node trigger-flaky-test-runner $ISSUE_NUMBER "$configs" |