Skip to content

Commit 22ab494

Browse files
authored
fix(ci): run release drafter with GITHUB_TOKEN (#10)
The workflow only ran when the org GitHub App was configured, which it isn't, so every run was skipped and no draft release existed. Use the same token-based workflow as the docs repo. Refs #9 Signed-off-by: Bugs5382 <12115015+Bugs5382@users.noreply.github.com> Co-authored-by: Bugs5382 <12115015+Bugs5382@users.noreply.github.com>
1 parent 3e28650 commit 22ab494

1 file changed

Lines changed: 13 additions & 51 deletions

File tree

Lines changed: 13 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,13 @@
11
name: Release Drafter
22

3-
# Drafts the next release on push to main and updates CHANGELOG.md before the
4-
# release is cut.
3+
# Drafts the next release on push to main, using the built-in GITHUB_TOKEN --
4+
# no org GitHub App required.
55
#
6-
# DISABLED until the org GitHub App is configured: every job is gated on
7-
# `vars.APP_CLIENT_ID`, so until that variable is set the job is skipped (no
8-
# runs, no failures). Once APP_CLIENT_ID (variable) and APP_PRIVATE_KEY
9-
# (secret) are set for the org/repo, it self-enables -- no edit required.
10-
#
11-
# The App token is used to push the CHANGELOG commit back to main. That commit
12-
# touches only CHANGELOG.md and carries [skip ci], so it never re-triggers
13-
# this workflow.
14-
#
15-
# Push to main only. The Label Checker workflow applies and checks the
16-
# categorizing label on every PR, so this workflow does not also run on pull
17-
# requests just to autolabel. That also keeps fork PRs clean: they get no
18-
# secrets, so the App token step could never run for them.
6+
# Push to main only. It used to run on pull requests too, where it only ran the
7+
# autolabeler; the Label Checker workflow applies and checks the label on every
8+
# PR, so that run cost a job per PR event for nothing. Dropping it also keeps
9+
# fork PRs clean: they get no secrets, so the drafter step could never run for
10+
# them.
1911

2012
on:
2113
push:
@@ -32,53 +24,23 @@ concurrency:
3224

3325
jobs:
3426
draft:
35-
name: Draft release and update changelog
36-
# Inert until the GitHub App is configured (see header).
37-
if: ${{ vars.APP_CLIENT_ID != '' }}
27+
name: Draft release
3828
runs-on: ubuntu-24.04
3929
timeout-minutes: 10
4030
permissions:
41-
contents: write # update releases + push the changelog commit
42-
pull-requests: read # release-drafter reads the merged PRs
31+
contents: write
32+
pull-requests: write
4333
steps:
44-
- name: Create GitHub App token
45-
id: app-token
46-
uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1
47-
with:
48-
client-id: ${{ vars.APP_CLIENT_ID }}
49-
private-key: ${{ secrets.APP_PRIVATE_KEY }}
50-
5134
- name: Checkout
52-
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.0.0
35+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
5336
with:
54-
token: ${{ steps.app-token.outputs.token }}
5537
fetch-depth: 0
5638

5739
- name: Release Drafter
58-
id: drafter
59-
uses: Bugs5382/release-drafter-action@de0c4559d69039b8b371ef951b62a2532ad3593f # v1.0.1
40+
uses: Bugs5382/release-drafter-action@de0c4559d69039b8b371ef951b62a2532ad3593f # v1.0.1
6041
with:
6142
token: ${{ secrets.GITHUB_TOKEN }}
62-
extends: CryptOS-PKI/.github@a04c9d10348665cfa0fe7de7d81e7d9fd3450292
43+
extends: CryptOS-PKI/.github@aa8761a2903d759dbb5f48b8d5e3517a9dc6da79
6344
first-version: 0.1.0
6445
prerelease: true
6546
prerelease-identifier: rc
66-
67-
- name: Update CHANGELOG
68-
uses: Bugs5382/changelog-updater-action@f873397e0c92387d9239bb471e46bc5fbaa9fbbd # v0.3.2
69-
env:
70-
LOG_LEVEL: debug
71-
LOG_FORMAT: text
72-
RELEASE_NOTES: >-
73-
${{ steps.drafter.outputs.body }}
74-
RELEASE_VERSION: v${{ steps.drafter.outputs.resolved_version }}
75-
with:
76-
tag: ${{ env.RELEASE_VERSION }}
77-
notes: ${{ env.RELEASE_NOTES }}
78-
diff: "true"
79-
80-
- name: Commit changelog
81-
uses: stefanzweifel/git-auto-commit-action@3ea6ae190baf489ba007f7c92608f33ce20ef04a # v4
82-
with:
83-
commit_message: "chore(pre-release): v${{ steps.drafter.outputs.resolved_version }} [skip ci]"
84-
file_pattern: CHANGELOG.md

0 commit comments

Comments
 (0)