Thanks to visit codestin.com
Credit goes to github.com

Skip to content

action to detect a keyword in the commit summary line #4764

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 5, 2021

Conversation

keewis
Copy link
Collaborator

@keewis keewis commented Jan 5, 2021

follow-up to #4729 and #4730

To use the detect-ci-trigger action in workflows, add a new job:

  detect-ci-trigger:
    name: Detect CI Trigger
    runs-on: ubuntu-latest
    outputs:
      triggered: ${{ steps.detect-trigger.outputs.trigger-found }}
    steps:
    - uses: actions/checkout@v2
    - uses: ./.github/actions/detect-ci-trigger
      id: detect-trigger
      with:
        keyword: "<keyword>"

then require the new job in jobs that should be conditionally skipped:

  my-ci-job:
    runs-on: ubuntu-latest
    needs: detect-ci-trigger
    if: needs.detect-ci-trigger.outputs.triggered == 'false'  # for skip-ci
    # if: needs.detect-ci-trigger.outputs.triggered == 'true'  # for test-upstream
    steps:
    - actions/checkout@v2
    # ...

unfortunately, this still requires actions/checkout with fetch-depth, I can't seem to get a git fetch in the action script to work. Edit: git fetch --deepen=1 instead of git fetch --depth=2 seems to work.

cc @andersy005

@keewis keewis added the CI Continuous Integration tools label Jan 5, 2021
@keewis keewis changed the title action to detect keywords in the commit summary line action to detect a keyword in the commit summary line Jan 5, 2021
@keewis
Copy link
Collaborator Author

keewis commented Jan 5, 2021

should we merge this first and then use it in #4729 and #4730?

Copy link
Member

@andersy005 andersy005 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great 👍🏽

should we merge this first and then use it in #4729 and #4730?

Sounds good

@keewis
Copy link
Collaborator Author

keewis commented Jan 5, 2021

thanks for the review, @andersy005.

@keewis keewis merged commit 0051975 into pydata:master Jan 5, 2021
@keewis keewis deleted the ci-trigger-action branch January 5, 2021 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI Continuous Integration tools
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants