Skip to content

Commit 77983cd

Browse files
committed
chore: Update changelog automation to use GitHub token and enhance error messaging
Signed-off-by: Harshit Kushwaha <find.harshitkushwaha@gmail.com>
1 parent ee3c826 commit 77983cd

3 files changed

Lines changed: 14 additions & 4 deletions

File tree

.chloggen/pr-2837.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
change_type: enhancement
2+
component:
3+
note: Automate changelog generation using fragment pattern
4+
issues: [2787]
5+
subtext:
6+
change_logs: [user]

.github/workflows/changelog-fragment.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
with:
2424
repository: ${{ github.event.pull_request.head.repo.full_name }}
2525
ref: ${{ github.head_ref }}
26-
token: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
26+
token: ${{ github.token }}
2727
fetch-depth: 0
2828

2929
- name: Install yq
@@ -143,7 +143,7 @@ jobs:
143143
with:
144144
repository: ${{ github.event.pull_request.head.repo.full_name }}
145145
ref: ${{ github.head_ref }}
146-
token: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
146+
token: ${{ github.token }}
147147
fetch-depth: 0
148148

149149
- name: Check skip conditions
@@ -180,7 +180,9 @@ jobs:
180180
fragment=".chloggen/pr-${PR_NUMBER}.yaml"
181181
182182
if [[ ! -f "$fragment" ]]; then
183-
echo "missing changelog fragment: $fragment"
183+
echo "❌ Missing changelog fragment: $fragment"
184+
echo "If you are contributing from a fork, you must create this file manually."
185+
echo "Copy the contents of .chloggen/TEMPLATE.yaml into a new file named $fragment, fill it out, and commit it to your branch."
184186
exit 1
185187
fi
186188

.github/workflows/draft-release-changelog.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ jobs:
3434
run: $(go env GOPATH)/bin/chloggen update --dry
3535

3636
- name: Compile changelog
37-
run: $(go env GOPATH)/bin/chloggen update --version ${{ inputs.version }}
37+
env:
38+
VERSION: ${{ inputs.version }}
39+
run: $(go env GOPATH)/bin/chloggen update --version "$VERSION"
3840

3941
- name: Create PR for Release Captain review
4042
uses: peter-evans/create-pull-request@v6

0 commit comments

Comments
 (0)