Skip to content
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

Merged
merged 6 commits into from Apr 10, 2024
Merged

Conversation

rprospero
Copy link
Contributor

This will enable GitHub runners that do not have a PR title (e.g. the continuous runn) to automatically pass the conventional commit checks.

@rprospero rprospero changed the title fail: Allow non-pr runs to pass ci fix: Allow non-pr runs to pass ci Apr 10, 2024
Comment on lines 18 to 25
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 .
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

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!

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 .
Copy link
Member

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed it is

@rprospero rprospero merged commit d27eb1c into develop Apr 10, 2024
6 checks passed
@rprospero rprospero deleted the fix-continuous-qc-titles branch April 10, 2024 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants