Skip to content

Commit

Permalink
Merge pull request #54 from github/jm-automated-releases-fix
Browse files Browse the repository at this point in the history
fix: automated release short tag detection
  • Loading branch information
jmeridth authored Apr 18, 2024
2 parents f6f2abb + a1de419 commit 833c00c
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ contact_links:
about: Ask a question or start a discussion
- name: GitHub OSPO GitHub Action Overall Issue
url: https://github.com/github/github-ospo/issues/new
about: File issue for multiple GitHub OSPO GitHuB Actions
about: File issue for multiple GitHub OSPO GitHub Actions
22 changes: 0 additions & 22 deletions .github/auto-labeler.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ examples: "feat: add new logger" or "fix: remove unused imports"

### Reviewer

- [ ] Label as either `bug`, `documentation`, `enhancement`, `infrastructure`, or `breaking`
- [ ] Label as either `fix`, `documentation`, `enhancement`, `infrastructure`, or `breaking`
22 changes: 22 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,25 @@ version-resolver:
- 'maintenance'
- 'documentation'
default: patch
autolabeler:
- label: 'automation'
title:
- '/^(build|ci|perf|refactor|test).*/i'
- label: 'enhancement'
title:
- '/^(chore|style).*/i'
- label: 'documentation'
title:
- '/^docs.*/i'
- label: 'feature'
title:
- '/^feat.*/i'
- label: 'fix'
title:
- '/^fix.*/i'
- label: 'infrastructure'
title:
- '/^infrastructure.*/i'
- label: 'revert'
title:
- '/^revert.*/i'
2 changes: 1 addition & 1 deletion .github/workflows/auto-labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
config-name: auto-labeler.yml
config-name: release-drafter.yml
20 changes: 18 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jobs:
outputs:
full-tag: ${{ steps.release-drafter.outputs.tag_name }}
short-tag: ${{ steps.get_tag_name.outputs.SHORT_TAG }}
body: ${{ steps.release-drafter.outputs.body }}
runs-on: ubuntu-latest
permissions:
contents: write
Expand All @@ -29,8 +30,8 @@ jobs:
- name: Get the short tag
id: get_tag_name
run: |
short-tag=$(echo ${{ steps.release-drafter.outputs.tag_name }} | cut -d. -f1)
echo "SHORT_TAG=$short-tag" >> $GITHUB_OUTPUT
short_tag=$(echo ${{ steps.release-drafter.outputs.tag_name }} | cut -d. -f1)
echo "SHORT_TAG=$short_tag" >> $GITHUB_OUTPUT
create_action_images:
needs: create_release
runs-on: ubuntu-latest
Expand Down Expand Up @@ -62,3 +63,18 @@ jobs:
platforms: linux/amd64,linux/arm64
provenance: false
sbom: false
create_discussion:
needs: create_release
runs-on: ubuntu-latest
permissions:
discussions: write
steps:
- name: Create an announcement discussion for release
uses: abirismyname/create-discussion@v1.2.0
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
title: ${{ needs.create_release.outputs.full-tag }}
body: ${{ needs.create_release.outputs.body }}
repository-id: "R_kgDOLLtong"
category-id: "DIC_kwDOLLtons4Cc0Oa"

0 comments on commit 833c00c

Please sign in to comment.