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

Remove explicit pull request event types from workflow #1288

Merged
merged 1 commit into from
Nov 3, 2023

Conversation

rdmark
Copy link
Member

@rdmark rdmark commented Nov 2, 2023

According to github docs, when not specifying pull request event type in the github workflow, the default events are "opened, synchronize, and reopened". However, the way we explicitly defined the event types caused the "synchronize" event (run the jobs when new commit is synchronized with the remote branch) to not trigger. Removing the explicitly defined events and using the default gets us the wanted behavior (e.g. triggering workflows on new commits to a PR branch.)

@rdmark rdmark changed the title Test push rules Remove workflow rules that caused incorrect behavior Nov 2, 2023
@rdmark
Copy link
Member Author

rdmark commented Nov 2, 2023

We seem to have been using the wrong syntax for events. The documentation suggests the array syntax for the list of event types. I tested this syntax:

  pull_request:
    paths:
      - 'cpp/**'
      - 'python/**'
      - '.github/workflows/cpp.yml'
    types: [assigned, opened, reopened, synchronize]

However this resulted in the duplicate sets of jobs, again. I'm not sure if this is expected, or a bug in github workflows.

@rdmark rdmark requested a review from uweseimet November 2, 2023 23:24
@rdmark rdmark changed the title Remove workflow rules that caused incorrect behavior Remove explicit pull request type from workflow Nov 2, 2023
@rdmark rdmark changed the title Remove explicit pull request type from workflow Remove explicit pull request event types from workflow Nov 2, 2023
Copy link

sonarcloud bot commented Nov 3, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@uweseimet
Copy link
Contributor

@rdmark Thank you for analyzing this.

@rdmark
Copy link
Member Author

rdmark commented Nov 3, 2023

@uweseimet You're welcome. Let me know if this works correctly for your workflow as well. I tested that subsequent changes to C++ or Python code triggered the jobs that I expected.

@rdmark rdmark merged commit d1a080b into develop Nov 3, 2023
7 checks passed
@rdmark rdmark deleted the rdmark-revert-push-rule branch November 3, 2023 07:54
@uweseimet
Copy link
Contributor

@rdmark I'm afraid there is no change. I just committed d1a080b and the anaylsis was not started.

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.

2 participants