publish-release:
runs-on: ubuntu-20.04
+ outputs:
+ prerelease: ${{ steps.get_version.outputs.prerelease }}
+ changelog: ${{ steps.create-release.outputs.body }}
+ version: ${{ steps.get_version.outputs.version }}
needs:
- build-release
if: github.ref_type == 'tag' && (startsWith(github.ref_name, 'v') || contains(github.ref_name, '-beta.rc'))
asset_path: ./paperless-ngx.tar.xz
asset_name: paperless-ngx-${{ steps.get_version.outputs.version }}.tar.xz
asset_content_type: application/x-xz
+
+ append-changelog:
+ runs-on: ubuntu-20.04
+ needs:
+ - publish-release
+ if: needs.publish-release.outputs.prerelease == 'false'
+ steps:
-
name: Checkout
uses: actions/checkout@v3
id: append-Changelog
working-directory: docs
run: |
- echo -e "# Changelog\n\n${{ steps.create-release.outputs.body }}\n" > changelog-new.md
+ git branch ${{ needs.publish-release.outputs.version }}-changelog
+ git checkout ${{ needs.publish-release.outputs.version }}-changelog
+ echo -e "# Changelog\n\n${{ needs.publish-release.outputs.changelog }}\n" > changelog-new.md
CURRENT_CHANGELOG=`tail --lines +2 changelog.md`
echo -e "$CURRENT_CHANGELOG" >> changelog-new.md
mv changelog-new.md changelog.md
git config --global user.name "github-actions"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git commit -am "Changelog ${{ steps.get_version.outputs.version }} - GHA"
- git push origin HEAD:main
+ git push origin ${{ needs.publish-release.outputs.version }}-changelog
+ -
+ name: Create Pull Request
+ uses: actions/github-script@v6
+ with:
+ script: |
+ const { repo, owner } = context.repo;
+ const result = await github.rest.pulls.create({
+ title: '[Documentation] Add ${{ needs.publish-release.outputs.version }} changelog',
+ owner,
+ repo,
+ head: '${{ needs.publish-release.outputs.version }}-changelog',
+ base: 'main',
+ body: 'This PR is auto-generated by CI.'
+ });
+ github.rest.issues.addLabels({
+ owner,
+ repo,
+ issue_number: result.data.number,
+ labels: ['documentation']
+ });