Skip to content

Commit

Permalink
chore: single autoupdate workflow to do everything
Browse files Browse the repository at this point in the history
  • Loading branch information
Shurtu-gal committed Feb 28, 2024
1 parent 1e4b481 commit 9b3983c
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 65 deletions.
46 changes: 0 additions & 46 deletions .github/workflows/autoupdate-pr-branches.yml

This file was deleted.

51 changes: 32 additions & 19 deletions .github/workflows/autoupdate.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
# This action is centrally managed in https://github.com/asyncapi/.github/
# This workflow is centrally managed in https://github.com/asyncapi/.github/
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo

# This workflow is designed to work with:
# - autoapprove and automerge workflows for dependabot and asyncapibot.
# - special release branches that we from time to time create in upstream repos. If we open up PRs for them from the very beginning of the release, the release branch will constantly update with new things from the destination branch they are opened against
# This workflow will run on every push to the repository or comment with /update or /u. And will create merge-commits for all PRs to respective branches.
# This also works with forks, not only with branches in the same repository/organization.
# Currently, does not work with forks in different organizations.

# It uses GitHub Action that auto-updates pull requests branches, whenever changes are pushed to their destination branch.
# Autoupdating to latest destination branch works only in the context of upstream repo and not forks
# This workflow will be distributed to all repositories in the AsyncAPI organization.

name: autoupdate
name: Autoupdate PR branches

on:
push:
Expand All @@ -18,18 +17,32 @@ on:
- 'bot/**'
- 'all-contributors/**'

issue_comment:
types: [created]

jobs:
autoupdate-for-bot:
if: startsWith(github.repository, 'asyncapi/')
name: Autoupdate autoapproved PR created in the upstream
autoupdate-fork:
if: >
startsWith(github.repository, 'asyncapi/') &&
(
github.event_name == 'push' ||
(
github.event_name == 'issue_comment' &&
github.event.issue.pull_request != null &&
(
contains(github.event.comment.body, '/update') ||
contains(github.event.comment.body, '/u')
)
)
)
runs-on: ubuntu-latest
steps:
- name: Autoupdating
uses: docker://chinthakagodawita/autoupdate-action:v1
env:
GITHUB_TOKEN: '${{ secrets.GH_TOKEN_BOT_EVE }}'
PR_FILTER: "labelled"
PR_LABELS: "autoupdate"
PR_READY_STATE: "ready_for_review"
MERGE_CONFLICT_ACTION: "ignore"

- name: Autoupdate PR branches
uses: Shurtu-gal/autoupdate-fork-action@a5019320a0462993ded9bbe6c04fb1c6684d67c7
with:
github_token: ${{ secrets.GH_TOKEN || secrets.GITHUB_TOKEN }}
# The label to see on push event. By default, on issue_comment event there will be no PR_FILTER
pr_filter: 'labelled'
pr_label: 'autoupdate'
merge_fail_action: 'comment'
ignore_conflicts: true

0 comments on commit 9b3983c

Please sign in to comment.