Skip to content

Commit

Permalink
Fix breaking changes workflow (#52)
Browse files Browse the repository at this point in the history
Currently, the breaking changes workflow is failing for push events ([example](https://github.com/DataDog/opentelemetry-mapping-go/actions/runs/4678758871)).

This is due to the fact that `github.head_ref` is only available when the event that triggers a workflow run is either `pull_request` or `pull_request_target` (see [doc](https://docs.github.com/en/actions/learn-github-actions/contexts#:~:text=GitHub%20GraphQL%20API.-,github.head_ref,-string)).

- link to [push events](https://github.com/DataDog/opentelemetry-mapping-go/actions?query=event%3Apush) ❌
- link to [pull_request events](https://github.com/DataDog/opentelemetry-mapping-go/actions?query=event%3Apull_request) ✅

This PR modifies the breaking changes workflow to only run when the event_name is `pull_request`.
  • Loading branch information
mackjmr authored Apr 12, 2023
1 parent 3f0bdb4 commit 412f048
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ jobs:

breaking-changes:
runs-on: ubuntu-latest
if: ${{ !contains(github.event.pull_request.labels.*.name, 'breaking-change')}}
if: ${{ !contains(github.event.pull_request.labels.*.name, 'breaking-change') && github.event_name == 'pull_request'}}
needs: [setup-environment]
steps:
- name: Checkout base branch
Expand Down

0 comments on commit 412f048

Please sign in to comment.