From 81df768b349c828ce068a87fa783a90d6e22d6d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Marks?= Date: Thu, 17 Nov 2022 14:35:58 +0100 Subject: [PATCH 1/2] Sync reference even if there are conflicts. Right now when there are conflicts between the language-reference-stable branch and the main, the CI is not creating sync PR. This results in growing gap between the stable reference and the main. I've changed the CI behavior, so the PR is always created. The person that is the author of last commit is assigned so they can fix potential conflicts. --- .github/workflows/language-reference.yaml | 44 +++++++++++------------ 1 file changed, 20 insertions(+), 24 deletions(-) diff --git a/.github/workflows/language-reference.yaml b/.github/workflows/language-reference.yaml index a661df490a3b..13353a0b9847 100644 --- a/.github/workflows/language-reference.yaml +++ b/.github/workflows/language-reference.yaml @@ -1,4 +1,4 @@ -name: language-reference-documentation +name: Language reference documentation on: push: @@ -14,14 +14,14 @@ permissions: jobs: build-and-push: + name: Build reference documentation and push it permissions: contents: write # for Git to git push - pull-requests: write # for peter-evans/create-pull-request to create a PR runs-on: ubuntu-latest steps: - name: Get current date id: date - run: echo "::set-output name=date::$(date +'%Y-%m-%d')" + run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT - name: Git Checkout uses: actions/checkout@v3 @@ -67,26 +67,22 @@ jobs: fi cd .. - - name: Merge changes to main - if: github.event_name == 'push' - run: | - cd dotty - git fetch origin main:main - git checkout main - git config user.name gh-actions - git config user.email actions@github.com - git merge language-reference-stable - cd .. - - - name: Create pull request with backport to main - if: github.event_name == 'push' - uses: peter-evans/create-pull-request@v4 + backport-to-main: + name: Create pull request with backport to main + permissions: + pull-requests: write # for peter-evans/create-pull-request to create a PR + runs-on: ubuntu-latest + if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' + steps: + - uses: actions/checkout@v3 + - uses: repo-sync/pull-request@v2 with: - path: dotty - branch: language-reference-backport - labels: area:documentation - title: Backport changes from stable documentation branch - body: This pull request is created automatically after push to stable documentation branch and backports the changes - reviewers: pikinier20,julienrf - assignees: pikinier20 + destination_branch: main + pr_label: area:documentation + pr_title: Sync with the stable documentation branch + pr_body: | + This pull request is syncing the `main` with changes from `language-reference-stable`. + + It was created automatically after ${{ github.event.head_commit.id }} by @${{ github.event.head_commit.author.username }} + pr_assignee: ${{ github.event.head_commit.author.username }} From 9d3c0d952de1f7f19f8cd63e0978aaef4a93fc3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Marks?= Date: Mon, 28 Nov 2022 16:52:48 +0100 Subject: [PATCH 2/2] Update the action name in the comment --- .github/workflows/language-reference.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/language-reference.yaml b/.github/workflows/language-reference.yaml index 13353a0b9847..3a02c7995ec3 100644 --- a/.github/workflows/language-reference.yaml +++ b/.github/workflows/language-reference.yaml @@ -70,7 +70,7 @@ jobs: backport-to-main: name: Create pull request with backport to main permissions: - pull-requests: write # for peter-evans/create-pull-request to create a PR + pull-requests: write # for repo-sync/pull-request to create a PR runs-on: ubuntu-latest if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' steps: