ci: add workflow to automatically update next branch (#5921)

* ci: add workflow to automatically update next branch

Signed-off-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>

* use environments, use non-deprecated GHA output

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

* set write permissions for contents

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

---------

Signed-off-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
Co-authored-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
risson 2023-06-12 12:25:24 +02:00 committed by GitHub
parent 51f4d4646c
commit 1ae36092c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 25 additions and 0 deletions

View File

@ -0,0 +1,25 @@
name: release-next-branch
on:
schedule:
- cron: "0 12 * * *" # every day at noon
workflow_dispatch:
permissions:
contents: write
jobs:
update-next:
runs-on: ubuntu-latest
environment: internal-production
steps:
- uses: actions/checkout@v3
with:
ref: main
- id: main-status
run: |
status=$(curl -fsSL -o head_status.json -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ github.token}}" "https://api.github.com/repos/${{ github.repository }}/commits/HEAD/status" | jq -r '.status')
echo "status=${status}" >> $GITHUB_OUTPUT
- if: ${{ steps.main-status.outputs.status == 'success' }}
run: |
git push origin next --force