-1

I want to trigger a python script on dynamic runner if any new release cut happens using github actions.

what i am trying is :

on:
  push:
    tags:
      - 'v*'
jobs:
  RunScript:
    runs-on: ubuntu-latest
    if: github.event.pull_request.merged == true
    steps:
      - name: Run Python Script
        id: PyScript
        run: |
          pip install semantic_version
          `python3 ./build-scripts/test.py`

please suggest a better way if any. thanks

1 Answer 1

0

You can use conditional statement so that it triggers on any release cu and it need not to start with "v"

on:
  push:
    tags:
      - '*'
jobs:
  RunScript:
    runs-on: ubuntu-latest
    if: (startsWith(github.ref, 'refs/tags/'))
    steps:
      - name: Run Python Script
        id: PyScript
        run: |
          pip install semantic_version
          `python3 ./build-scripts/test.py`
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.