-
Notifications
You must be signed in to change notification settings - Fork 16
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
fix: Allow non-pr runs to pass ci #1839
Conversation
.github/workflows/qc/action.yml
Outdated
run: | | ||
set -ex | ||
echo ${{ github.event.pull_request.title }} | awk "/(^feat:)|(^fix:)|(^doc:)|(^perf:)|(^refactor:)|(^style:)|(^test:)|(^chore:)|(^revert:)|(^build:)/" | grep . | ||
TITLE="${{ github.event.pull_request.title }}" | ||
if [ -z "$TITLE" ] | ||
then | ||
TITLE=Continuous | ||
fi | ||
echo $TITLE | awk "/(Continuous)|(^feat:)|(^fix:)|(^doc:)|(^perf:)|(^refactor:)|(^style:)|(^test:)|(^chore:)|(^revert:)|(^build:)/" | grep . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just an alternative suggestion, but you could avoid the if/else title set and check by adding if: github.event_name == 'pull_request'
on to the step perhaps?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@trisyoungs That had been my original idea, but I was paranoid that I wouldn't be able to test it. However, looking at it again, you're right that the simplicity makes it worth the change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rprospero Sometimes its hard to have faith in the mess that is GitHub if
checks, but live dangerously I say!
.github/workflows/qc/action.yml
Outdated
shell: bash | ||
run: | | ||
set -ex | ||
echo ${{ github.event.pull_request.title }} | awk "/(^feat:)|(^fix:)|(^doc:)|(^perf:)|(^refactor:)|(^style:)|(^test:)|(^chore:)|(^revert:)|(^build:)/" | grep . | ||
echo ${{ github.event.pull_request.title }} | awk "/(Continuous)|(^feat:)|(^fix:)|(^doc:)|(^perf:)|(^refactor:)|(^style:)|(^test:)|(^chore:)|(^revert:)|(^build:)/" | grep . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Guess this change is redundant now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed it is
This will enable GitHub runners that do not have a PR title (e.g. the continuous runn) to automatically pass the conventional commit checks.