From 1ae36092c91f770b36665165422c0426fd36cb4c Mon Sep 17 00:00:00 2001 From: risson <18313093+rissson@users.noreply.github.com> Date: Mon, 12 Jun 2023 12:25:24 +0200 Subject: [PATCH] ci: add workflow to automatically update next branch (#5921) * ci: add workflow to automatically update next branch Signed-off-by: Marc 'risson' Schmitt * use environments, use non-deprecated GHA output Signed-off-by: Jens Langhammer * set write permissions for contents Signed-off-by: Jens Langhammer --------- Signed-off-by: Marc 'risson' Schmitt Signed-off-by: Jens Langhammer Co-authored-by: Jens Langhammer --- .github/workflows/release-next-branch.yml | 25 +++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/release-next-branch.yml diff --git a/.github/workflows/release-next-branch.yml b/.github/workflows/release-next-branch.yml new file mode 100644 index 000000000..1e0ec98d4 --- /dev/null +++ b/.github/workflows/release-next-branch.yml @@ -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