diff --git a/.github/labels-calver.yml b/.github/labels-calver.yml new file mode 100644 index 0000000..d4d264b --- /dev/null +++ b/.github/labels-calver.yml @@ -0,0 +1,9 @@ +- color: FF5959 + description: Breaking changes which must be reviewed before being included in the monthly release. + name: 'calver: breaking' +- color: AB9EF7 + description: Changes which should be included in the monthly release. + name: 'calver: monthly' +- color: 9EC9F7 + description: Non-breaking changes which should be included in a patch release. + name: 'calver: patch' \ No newline at end of file diff --git a/.github/workflows/pr-enforce-semver-labels.yml b/.github/workflows/pr-enforce-calver-labels.yml similarity index 77% rename from .github/workflows/pr-enforce-semver-labels.yml rename to .github/workflows/pr-enforce-calver-labels.yml index 7542a08..b65fd05 100644 --- a/.github/workflows/pr-enforce-semver-labels.yml +++ b/.github/workflows/pr-enforce-calver-labels.yml @@ -6,9 +6,9 @@ on: description: A GitHub personal access token with write access to the project jobs: - enforce-semver-labels: + enforce-calver-labels: uses: localstack/meta/.github/workflows/pr-enforce-pr-labels.yml@main with: - labels: "semver: patch, semver: minor, semver: major" + labels: "calver: patch, calver: monthly, calver: breaking" secrets: github-token: ${{ secrets.github-token }} \ No newline at end of file diff --git a/.github/workflows/pr-enforce-label-group.yml b/.github/workflows/pr-enforce-label-group.yml new file mode 100644 index 0000000..28e67fb --- /dev/null +++ b/.github/workflows/pr-enforce-label-group.yml @@ -0,0 +1,40 @@ +# Ensures all the relevant groups of labels are applied to a PR. +name: Enforce All PR Labels + +on: + workflow_call: + secrets: + github-token: + required: true + description: A GitHub personal access token with write access to the project + +jobs: + calver: + name: Calendar Versioning Labels + runs-on: ubuntu-latest + steps: + - uses: localstack/meta/.github/workflows/pr-enforce-pr-labels.yml@main + with: + labels: "calver: patch, calver: monthly, calver: breaking" + secrets: + github-token: ${{ secrets.github-token }} + + docs: + name: Documentation Labels + runs-on: ubuntu-latest + steps: + - uses: localstack/meta/.github/workflows/pr-enforce-pr-labels.yml@main + with: + labels: "docs: needed, docs: skip" + secrets: + github-token: ${{ secrets.github-token }} + + notes: + name: Notes Labels + runs-on: ubuntu-latest + steps: + - uses: localstack/meta/.github/workflows/pr-enforce-pr-labels.yml@main + with: + labels: "notes: needed, notes: skip" + secrets: + github-token: ${{ secrets.github-token }} \ No newline at end of file diff --git a/.github/workflows/pr-enforce-labels.yml b/.github/workflows/pr-enforce-labels.yml deleted file mode 100644 index e2016ee..0000000 --- a/.github/workflows/pr-enforce-labels.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: Enforce PR labels - -on: - workflow_call: - secrets: - github-token: - required: true - description: A GitHub personal access token with write access to the project - -jobs: - semver: - runs-on: ubuntu-latest - steps: - - uses: mheap/github-action-required-labels@v5 - with: - mode: exactly - count: 1 - labels: "semver: patch, semver: minor, semver: major" - token: ${{ secrets.github-token }} - - docs: - runs-on: ubuntu-latest - steps: - - uses: mheap/github-action-required-labels@v5 - with: - mode: exactly - count: 1 - labels: "docs: needed, docs: skip" - token: ${{ secrets.github-token }} - - notes: - runs-on: ubuntu-latest - steps: - - uses: mheap/github-action-required-labels@v5 - with: - mode: exactly - count: 1 - labels: "notes: needed, notes: skip" - token: ${{ secrets.github-token }} diff --git a/.github/workflows/pr-enforce-no-major.yml b/.github/workflows/pr-enforce-no-major.yml deleted file mode 100644 index 31032d3..0000000 --- a/.github/workflows/pr-enforce-no-major.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: Enforce no major labels - -on: - workflow_call: - secrets: - github-token: - required: true - description: A GitHub token with access to the issues of the calling repo - -jobs: - # make sure no PRs with major label are merged - enforce-no-major-label: - runs-on: ubuntu-latest - permissions: - issues: write - pull-requests: write - steps: - - uses: mheap/github-action-required-labels@v5 - with: - mode: exactly - count: 0 - labels: "semver: major" - add_comment: true - token: ${{ secrets.github-token }} - message: "Currently, only minor and patch changes are allowed on main. Your PR labels ({{ applied }}) indicate that it cannot be merged into the main at this time." diff --git a/.github/workflows/pr-enforce-no-major-minor.yml b/.github/workflows/pr-enforce-patch-only.yml similarity index 75% rename from .github/workflows/pr-enforce-no-major-minor.yml rename to .github/workflows/pr-enforce-patch-only.yml index 71dfeea..0d6a2c6 100644 --- a/.github/workflows/pr-enforce-no-major-minor.yml +++ b/.github/workflows/pr-enforce-patch-only.yml @@ -1,4 +1,5 @@ -name: Enforce no major or minor labels +# Enforces changes merged to main to be of patch only. Activated during a release code-freeze. +name: Enforce Patch Only on: workflow_call: @@ -8,7 +9,6 @@ on: description: A GitHub token with access to the issues of the calling repo jobs: - # make sure no PRs with major or minor label are merged enforce-no-major-label: runs-on: ubuntu-latest permissions: @@ -19,7 +19,7 @@ jobs: with: mode: exactly count: 0 - labels: "semver: major, semver: minor" + labels: "calver: monthly, calver: breaking, semver: minor, semver: major" add_comment: true token: ${{ secrets.github-token }} message: "Currently, only patch changes are allowed on main. Your PR labels ({{ applied }}) indicate that it cannot be merged into the main at this time." diff --git a/.github/workflows/pr-enforce-pr-labels.yml b/.github/workflows/pr-enforce-pr-labels.yml index ee96761..1c13f20 100644 --- a/.github/workflows/pr-enforce-pr-labels.yml +++ b/.github/workflows/pr-enforce-pr-labels.yml @@ -6,14 +6,13 @@ on: labels: required: true type: string - description: "comma separated list of labels where exactly one has to be set on PRs" + description: "A comma separated list of labels where exactly one has to be set on PRs." secrets: github-token: required: true - description: A GitHub token with access to the issues of the calling repo + description: "A GitHub token with access to the issues of the calling repo." jobs: - # make sure _all_ PRs have a semver label enforce-pr-labels: runs-on: ubuntu-latest steps: