Skip to content

Commit

Permalink
feat: Add release drafter common github action.
Browse files Browse the repository at this point in the history
  • Loading branch information
iphydf committed Nov 6, 2024
1 parent 5e2f2c8 commit 2b74b8d
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 2 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/check-release.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# WARNING: Actions in this file can access repository secrets. They should never
# execute code of the pull request. All scripts should be fetched from merged
# TokTok code.
on:
workflow_call:
on: [workflow_call]

jobs:
check-release:
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: checks

on:
pull_request_target:
branches: [master]

jobs:
checks:
uses: ./.github/workflows/check-release.yml
26 changes: 26 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# WARNING: Actions in this file can access repository secrets. They should never
# execute code of the pull request. All scripts should be fetched from merged
# TokTok code.
on: [workflow_call]

permissions:
contents: read

jobs:
update_release_draft:
permissions:
# write permission is required to create a github release
contents: write
# write permission is required for autolabeler
# otherwise, read permission is required at least
pull-requests: write
runs-on: ubuntu-latest
steps:
# Drafts your next Release notes as Pull Requests are merged into "master"
- uses: release-drafter/release-drafter@v6
# (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml
# with:
# config-name: my-config.yml
# disable-autolabeler: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
12 changes: 12 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: release

on:
push:
branches: [master]
pull_request_target:
branches: [master]
types: [opened, reopened, synchronize]

jobs:
release:
uses: ./.github/workflows/release-drafter.yml

0 comments on commit 2b74b8d

Please sign in to comment.