-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
83 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
name: 'pre-Release Changelog Update' | ||
|
||
on: | ||
workflow_call: | ||
release: | ||
types: [prereleased] | ||
|
||
jobs: | ||
update: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
# Push to protected branches | ||
# If your repository uses protected branches you have to make some changes | ||
# to your Workflow for the Action to work properly: | ||
# | ||
# You need a Personal Access Token and you either have to | ||
# a) allow force pushes | ||
# or | ||
# b) the Personal Access Token needs to belong to an Administrator. | ||
# | ||
# Add the following to the 'with:' group: 'token: ${{ secrets.PAT }}' | ||
# | ||
uses: actions/checkout@v3 | ||
with: | ||
token: ${{ secrets.BOT_TOKEN }} | ||
ref: ${{ github.event.release.target_commitish }} | ||
|
||
- name: Update Changelog | ||
uses: stefanzweifel/changelog-updater-action@v1 | ||
with: | ||
release-notes: ${{ github.event.release.body }} | ||
latest-version: ${{ github.event.release.tag_name }} | ||
|
||
- uses: EndBug/add-and-commit@v9 | ||
with: | ||
add: 'CHANGELOG.md' | ||
message: Update changelog to ${{ github.event.release.tag_name }} | ||
# Whether to push the commit and, if any, its tags to the repo. It can also be used to set the git push arguments (see the paragraph below for more info) | ||
# Default: true | ||
push: false | ||
committer_name: Frieda Theodor Automatisierungs-Bot <email-roboter@figuren.theater> | ||
committer_email: email-roboter@figuren.theater | ||
|
||
- name: Push to protected branch | ||
uses: CasperWA/push-protected@v2 | ||
with: | ||
token: ${{ secrets.BOT_TOKEN }} | ||
branch: ${{ github.event.release.target_commitish }} | ||
unprotect_reviews: true | ||
|
||
|
||
# @TODO #57 Automatically bump version in all relevant files | ||
|
||
# - name: Create Pull Request | ||
# uses: peter-evans/create-pull-request@v3 | ||
# with: | ||
# token: ${{ secrets.BOT_TOKEN }} | ||
# commit-message: update changelog | ||
# title: Update Changelog | ||
# body: Update changelog to reflect release changes | ||
# branch: update-changelog | ||
# base: ${{ github.event.release.target_commitish }} | ||
|
||
- name: publish pre-Release as Release | ||
uses: actions/github-script@v5 | ||
with: | ||
github-token: ${{ secrets.BOT_TOKEN }} | ||
script: | | ||
const { owner, repo } = context.repo; | ||
const release = await github.repos.getReleaseByTag({ | ||
owner, | ||
repo, | ||
tag: context.ref.replace('refs/tags/', '') | ||
}); | ||
await github.repos.updateRelease({ | ||
owner, | ||
repo, | ||
release_id: release.data.id, | ||
draft: false, | ||
prerelease: false | ||
}); |
File renamed without changes.