Skip to content

Commit

Permalink
Trigger on comment
Browse files Browse the repository at this point in the history
  • Loading branch information
jsoriano committed Jul 25, 2024
1 parent a2302d9 commit b3fd17e
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions .github/workflows/bump-elastic-stack-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@ on:
workflow_dispatch:
schedule:
- cron: '0 1 * * 1-5'
issue_comment:
types: ['created']

permissions:
contents: read

jobs:
bump-elastic-stack:
if: ${{ github.event_name != 'issue_comment' || (github.event.issue.pull_request && contains(github.event.comment.body, '/test bump-stack')) }}
runs-on: ubuntu-latest
permissions:
contents: write
Expand All @@ -23,14 +26,24 @@ jobs:
- name: Install Updatecli in the runner
uses: updatecli/[email protected] # updatecli v0.80.0

- name: Select diff action
if: ${{ github.event_name == 'issue_comment' }}
run: |
echo "UPDATECLI_ACTION=diff" >> $GITHUB_ENV
- name: Select apply action
if: ${{ github.event_name != 'issue_comment' }}
run: |
echo "UPDATECLI_ACTION=apply" >> $GITHUB_ENV
- name: Update latest testing 7.x stack version
# --experimental needed for commitusingapi option.
run: updatecli --experimental apply --config .github/workflows/updatecli.d/bump-latest-7x-version.yml --values .github/workflows/updatecli.d/scm.yml
run: updatecli --experimental ${{ env.UPDATECLI_ACTION }} --config .github/workflows/updatecli.d/bump-latest-7x-version.yml --values .github/workflows/updatecli.d/scm.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Update latest testing stack version
# --experimental needed for commitusingapi option.
run: updatecli --experimental apply --config .github/workflows/updatecli.d/bump-latest-snapshot-version.yml --values .github/workflows/updatecli.d/scm.yml
run: updatecli --experimental ${{ env.UPDATECLI_ACTION }} --config .github/workflows/updatecli.d/bump-latest-snapshot-version.yml --values .github/workflows/updatecli.d/scm.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit b3fd17e

Please sign in to comment.