Skip to content

Commit

Permalink
chore(develop): Merge changes from develop into main (#23)
Browse files Browse the repository at this point in the history
Co-authored-by: Tino Goratsch <tino.goratsch@bike24.net>
  • Loading branch information
github-actions[bot] and tinogo authored Dec 19, 2023
1 parent 7485926 commit bb6cb3d
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 7 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/actionlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Lint GitHub Actions workflows
on:
pull_request:
branches:
- develop
- main

jobs:
actionlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: actionlint
uses: raven-actions/actionlint@v1
with:
flags: "-ignore SC2086 -ignore SC2116"
20 changes: 20 additions & 0 deletions .github/workflows/lint-pr-titles.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: "Lint PR"

on:
pull_request_target:
types:
- opened
- edited
- synchronize

permissions:
pull-requests: read

jobs:
validate-pr-title:
name: Validate PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
12 changes: 10 additions & 2 deletions .github/workflows/merge-develop-into-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,21 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Configure Git
run: |
git config --global user.email "norepl@github.com"
git config --global user.name "GitHub Actions Bot"
- name: 'Create merge branch: develop --> main'
run: |
git checkout release/merge-develop-into-main || git checkout -b release/merge-develop-into-main
git checkout -b release/merge-develop-into-main
git rebase develop
git pull -r origin main
git push --set-upstream origin release/merge-develop-into-main --force
- name: Create PR
run: |
(gh pr --repo $GITHUB_REPOSITORY create --fill --title "chore(develop): Merge changes from develop into main" --base main) || exit 0
(gh pr --repo $GITHUB_REPOSITORY create --fill --title "chore(develop): Merge changes from develop into main" --reviewer tinogo --base main) || exit 0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18 changes: 13 additions & 5 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,18 @@ jobs:
with:
fetch-depth: 0

- name: Configure Git
if: ${{ steps.release.outputs.release_created }}
run: |
git config --global user.email "norepl@github.com"
git config --global user.name "GitHub Actions Bot"
- name: 'Create merge branch: main --> develop'
if: ${{ steps.release.outputs.release_created }}
run: |
git checkout release/merge-main-into-develop || git checkout -b release/merge-main-into-develop
git checkout -b release/merge-main-into-develop
git rebase main
git pull -r origin develop
git push --set-upstream origin release/merge-main-into-develop --force
- name: Create PR
Expand All @@ -42,8 +49,9 @@ jobs:
- name: Enable auto-merge for the PR
if: ${{ steps.release.outputs.release_created }}
run: |
pull_request_url=$(gh pr view release/merge-main-into-develop --json url --jq '. | .url')
gh pr --repo $GITHUB_REPOSITORY merge $pull_request_url --auto --merge
gh pr --repo $GITHUB_REPOSITORY review $pull_request_url --approve
gh pr --repo $GITHUB_REPOSITORY review release/merge-main-into-develop --approve
gh pr --repo $GITHUB_REPOSITORY merge release/merge-main-into-develop --auto --merge
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# the approver of a PR can not be the same user as the creator of the PR.
# That's why we are sticking with the default runner user here
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}

0 comments on commit bb6cb3d

Please sign in to comment.