Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 20 additions & 5 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,29 @@ jobs:
create_release:
# release if
# manual deployment OR
# merged to main and labelled with release labels
# merged to main and labelled with release labels (breaking, feature, vuln) OR
# merged to main and labelled with release + a semver label (major, minor, OR patch)
if: |
(github.event_name == 'workflow_dispatch') ||
(
github.event_name == 'workflow_dispatch') ||
(github.event.pull_request.merged == true &&
(contains(github.event.pull_request.labels.*.name, 'breaking') ||
(
contains(github.event.pull_request.labels.*.name, 'breaking') ||
contains(github.event.pull_request.labels.*.name, 'feature') ||
contains(github.event.pull_request.labels.*.name, 'vuln') ||
contains(github.event.pull_request.labels.*.name, 'release')))
contains(github.event.pull_request.labels.*.name, 'vuln')
) ||
(
contains(github.event.pull_request.labels.*.name, 'release') &&
contains(github.event.pull_request.labels.*.name, 'major')
) ||
(
contains(github.event.pull_request.labels.*.name, 'release') &&
contains(github.event.pull_request.labels.*.name, 'minor')
) ||
(
contains(github.event.pull_request.labels.*.name, 'release') &&
contains(github.event.pull_request.labels.*.name, 'patch')
))
outputs:
full-tag: ${{ steps.release-drafter.outputs.tag_name }}
short-tag: ${{ steps.get_tag_name.outputs.SHORT_TAG }}
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ This is a placeholder repo for multiple GitHub Actions we use in open source pro
>
> [Workflows](.github/workflows)

> [!CAUTION]
> In our default `release-drafter.yaml` file and hardcoded in our `release.yaml` reusable workflow, we use the labels `major`, `minor`, and `patch` to determine the type of release to create. Unfortunately, Dependabot uses these same labels, by default, on its PRs to indicate the type of version update. This can cause unintended releases to be created when Dependabot PRs are merged.
> The "fix" is to include `labels: ["package-name", "dependencies"]` in your `dependabot.yaml` configuration file to ensure Dependabot PRs are labeled correctly and do not use the `major`, `minor`, or `patch` labels.
> You can see an example of this in the [dependabot.yaml](.github/dependabot.yaml) file in this repository.
> [!TIP]
> In order to update the semver version of a release both the `release` and a semver label (`major`, `minor`, or `patch`) must be used on the pull request that is merged to `main`.
>
> This is to prevent accidental version bumps from pull requests that are not intended to be releases. (example: Dependabot PRs that label themselves with semver labels)

> [!TIP]
> You can reuse the following files in this repository in your own as they are used by the reusable workflows:
Expand Down
Loading