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

feat: Add workflow step for conventional release labels #108

Merged
merged 5 commits into from
Jan 6, 2025
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
36 changes: 32 additions & 4 deletions .github/workflows/close-stale.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,34 @@
default: '.'
required: false
type: string
days_before_issue_stale:
tfhartmann marked this conversation as resolved.
Show resolved Hide resolved
description: Number of days before an issue is considered stale.
default: 60
required: false
type: number

days_before_pr_stale:
description: Number of days before a PR is considered stale.
default: 60
required: false
type: number

days_before_issue_close:
description: >-
The idle number of days before closing the stale issues or
the stale pull requests (due to the stale label).
default: 5
required: false
type: number

days_before_pr_close:
description: >-
The idle number of days before closing the stale issues or
the stale pull requests (due to the stale label).
default: 10
required: false
type: number


jobs:
stale:
Expand All @@ -34,7 +62,7 @@ jobs:
This issue was closed because it has been stalled for 5 days with no activity.
close-pr-message: |
This PR was closed because it has been stalled for 10 days with no activity.
days-before-issue-stale: 60
days-before-pr-stale: 60
days-before-issue-close: 5
days-before-pr-close: 10
days-before-issue-stale: ${{ inputs.days_before_issue_stale }}
days-before-pr-stale: ${{ inputs.days_before_pr_stale }}
days-before-issue-close: ${{ inputs.days_before_issue_close }}
days-before-pr-close: ${{ inputs.days_before_pr_close }}
6 changes: 6 additions & 0 deletions .github/workflows/conventional-commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ jobs:
run:
working-directory: ${{ inputs.working_directory }}
runs-on: ${{ inputs.jobs_run_on }}
if: ${{ github.actor != 'dependabot[bot]' || github.actor != 'pre-commit-ci[bot]'}}
steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -79,3 +80,8 @@ jobs:
# yamllint disable-line rule:line-length
run: npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose
timeout-minutes: ${{ inputs.timeout_minutes }}

label:
runs-on: ubuntu-latest
steps:
- uses: bcoe/[email protected]
41 changes: 41 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ jobs:
stale:
uses: broadinstitute/shared-workflows/.github/workflows/close-stale.yaml
```
#### close-stale Inputs

* `days_before_issue_stale`: Number of days before an issue is considered stale. Default to 60
* `days_before_pr_stale`: Description: Number of days before a PR is considered stale. Default to 60
* `days_before_issue_close`: The idle number of days before closing the stale issues or the stale pull requests (due to the stale label). Defaults to 5
* `days_before_pr_close`: The idle number of days before closing the stale issues or the stale pull requests (due to the stale label). Defaults to 10

### conventional-commit.yaml

Expand All @@ -65,6 +71,41 @@ In addition the 'subject-case' and 'body-max-line-length' checks are disabled.
* `validate_current_commit`: Validate current commit (last commit). Default: false
* validate_pr_commits: Validate PR commits. Default: false

#### Conventional Release-Labels

The conventional commit workflow will also add labels to the PR based on
based on Conventional Commits. By default, only labels are added.

These labels can be used in conjunction GitHub's
[automatically generated release notes](https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes)

In order to use this automatic release notes feature, you must a `.github/release.yaml` file

```Yaml
changelog:
exclude:
labels:
- ignore-for-release
authors:
- octocat
categories:
- title: Breaking Changes 🛠
labels:
- breaking
- title: Exciting New Features 🎉
labels:
- feature
- title: Fixes 🔧
labels:
- fix
- title: Other Changes
labels:
- "*"
```

More info on this can be found in the [release labels action](https://github.com/bcoe/conventional-release-labels?tab=readme-ov-file#conventional-release-labels)
and the [release-please-action](https://github.com/googleapis/release-please-action)

### local-checks.yaml

These are local Actions that run for this repository. This workflow is not
Expand Down
Loading