Skip to content

Commit b84a9dc

Browse files
committed
Various improvements and testing
1 parent f4bb322 commit b84a9dc

File tree

3 files changed

+20
-4
lines changed

3 files changed

+20
-4
lines changed

.github/workflows/check-changelog.yml

+6
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,18 @@ on:
66
# Edited such that we can detect changes to the description
77
types: [opened, synchronize, reopened, edited]
88

9+
permissions:
10+
pull-requests: read
11+
912
jobs:
1013
check:
1114
runs-on: ubuntu-latest
1215
steps:
1316
- uses: actions/checkout@v4
1417
with:
18+
# We need to fetch the parents of the HEAD commit (which is a merge),
19+
# because we need to compare the PR against the base branch
20+
# to check whether it added a changelog
1521
fetch-depth: 2
1622

1723
- name: check changelog

.github/workflows/main.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,16 @@ jobs:
4545
GH_TOKEN: ${{ github.token }}
4646

4747
- name: Outputting draft release notes
48+
# If we have a new version at all (it's not an empty string)
49+
# And it's not a push event (so it's a PR),
4850
if: ${{ env.version && github.event_name != 'push' }}
51+
# we just output the draft changelog into the step summary
4952
run: cat changes/released/${{ env.version }}.md > "$GITHUB_STEP_SUMMARY"
5053

5154
- name: Update release branch
52-
#if: ${{ env.version && github.event_name == 'push' }}
55+
# But if this is a push te the main branch,
56+
if: ${{ env.version && github.event_name == 'push' }}
57+
# we push to the release branch.
5358
# This continuously updates the release branch to contain the latest release notes,
5459
# so that one can just merge the release branch into main to do a release.
5560
# A PR to do that is opened regularly with another workflow

.github/workflows/regular-release.yml

+8-3
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,22 @@ on:
33
workflow_dispatch: # Allows triggering manually
44
schedule:
55
- cron: '47 14 * * 2' # runs every Tuesday at 14:47 UTC (chosen somewhat randomly)
6+
pull_request:
7+
branches:
8+
main
69

710
jobs:
811
version:
912
runs-on: ubuntu-latest
1013
steps:
14+
- uses: actions/checkout@v4
15+
1116
- name: Create Pull Request
1217
run: |
18+
subject=$(git log -1 --format=%s HEAD)
1319
gh pr create \
14-
--repo ${{ github.repository }} \
15-
--fill \
16-
--head release
20+
--title "$(head -1 <<< "$subject")" \
21+
--body "$(tail -1 <<< "$subject")"
1722
env:
1823
# Needed so that CI triggers
1924
GH_TOKEN: ${{ secrets.MACHINE_USER_PAT }}

0 commit comments

Comments
 (0)