Skip to content

Commit 048a6ad

Browse files
authored
chore: Docs team review improvements in dev branches (#3466)
* TEMPORARY send to test channel * don't notify docs team if label skip-docs-notification * TEMPORARY doc change * add label skip label in update dev branches GHA * Revert "TEMPORARY doc change" This reverts commit de69883. * Revert "TEMPORARY send to test channel" This reverts commit c7e2746. * detect changes * don't create the PR is no new changes * fix linter * add step names
1 parent 7fb1b47 commit 048a6ad

File tree

2 files changed

+25
-7
lines changed

2 files changed

+25
-7
lines changed

.github/workflows/notify-docs-team.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66

77
jobs:
88
check:
9-
if: github.event.pull_request.draft == false
9+
if: github.event.pull_request.draft == false && !contains(github.event.pull_request.labels.*.name, 'skip-docs-notification')
1010
runs-on: ubuntu-latest
1111
outputs:
1212
files: ${{ steps.changes.outputs.files }}

.github/workflows/update-dev-branches.yml

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,19 @@ jobs:
3131
contents: write
3232
pull-requests: write
3333
steps:
34-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
34+
- name: Checkout repo
35+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
3536
with:
3637
fetch-depth: 0
37-
- run: |
38+
39+
- name: Config Git
40+
run: |
3841
git config --local user.email [email protected]
3942
git config --local user.name svc-apix-bot
4043
41-
- run: |
44+
- name: Rebase branch with master
45+
id: rebase-check
46+
run: |
4247
echo "Updating branch: ${{ matrix.branch }}"
4348
4449
if ! git ls-remote --heads origin ${{ matrix.branch }} | grep -q ${{ matrix.branch }}; then
@@ -69,24 +74,37 @@ jobs:
6974
exit 1
7075
fi
7176
fi
77+
78+
# Check if there are any changes between rebased branch and original remote branch
79+
if git diff --quiet origin/${{ matrix.branch }} HEAD; then
80+
echo "No changes detected between rebased branch and original remote branch. PR would not introduce any changes."
81+
echo "has-changes=false" >> "${GITHUB_OUTPUT}"
82+
else
83+
echo "Changes detected between rebased branch and original remote branch. PR will introduce changes."
84+
echo "has-changes=true" >> "${GITHUB_OUTPUT}"
85+
fi
7286
73-
- uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e
87+
- name: Create pull request
88+
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e
89+
if: steps.rebase-check.outputs.has-changes == 'true'
7490
with:
7591
token: ${{ secrets.APIX_BOT_PAT }}
7692
title: "chore: Update ${{ matrix.branch }} from master"
7793
commit-message: "Update ${{ matrix.branch }} from master"
7894
delete-branch: true
7995
branch: update-${{ matrix.branch }}-from-master
8096
base: ${{ matrix.branch }}
81-
body: "Automated update of ${{ matrix.branch }} branch with latest changes from master branch."
97+
body: "Automated update of `${{ matrix.branch }}` branch with latest changes from master branch."
98+
labels: "skip-docs-notification"
8299

83100
slack-notification:
84101
needs: update-branches
85102
if: ${{ !cancelled() && needs.update-branches.result == 'failure' }}
86103
runs-on: ubuntu-latest
87104
permissions: {}
88105
steps:
89-
- uses: slackapi/slack-github-action@b0fa283ad8fea605de13dc3f449259339835fc52
106+
- name: Send Slack notification on failure
107+
uses: slackapi/slack-github-action@b0fa283ad8fea605de13dc3f449259339835fc52
90108
with:
91109
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
92110
webhook-type: incoming-webhook

0 commit comments

Comments
 (0)