Conversation
|
|
||
| jobs: | ||
| dependency_changelog: | ||
| if: ${{ github.event.label.name == 'dependencies' }} |
There was a problem hiding this comment.
In theory this would also kick-off if another label was added after the dependencies label, but nothing would happen since the changelog file would already exist, correct?
There was a problem hiding this comment.
@leahwicz, correct. There's not a way I know of to only run if a specific label is added. So this will run, then it hits a check for if the changelog exists:
dbt-core/.github/workflows/dependency-changelog.yml
Lines 61 to 75 in efd1585
And should the pass on adding another one.
I could add another if to check if the action was labeled and the label was dependencies. IT would still trigger the workflow but would fail sooner. Something like this (syntax may be wrong):
jobs:
dependency_changelog:
if: |
(${{ github.event == 'opened' }} && "contains(github.event.pull_request.labels.*.name, 'dependencies')")
|| (${{ github.event == 'labeled' }} && ${{ github.event.label.name == 'dependencies' }})
There was a problem hiding this comment.
Yeah what you have is fine then since it does check for the changelog existing so the danger of the workflow running multiple times is accounted for. 🚢 it!
Fix small bug where action to add changelog file never kicked off if the label was added before PR creation. It still worked if you added label after creation.
test to add label after PR creation
test to add label before PR creation
This should eventually be moved over to shared actions since we will need it across multiple repos.
Checklist
This PR includes tests, ortests are not required/relevant for this PRI have opened an issue to add/update docs, ordocs changes are not required/relevant for this PRI have runchangie newto create a changelog entry