From b6e901958af7b96df7684eea573415815140f709 Mon Sep 17 00:00:00 2001 From: bmorelli25 Date: Wed, 22 May 2024 09:29:39 -0700 Subject: [PATCH 1/5] simplified action that produces conflicts --- .../delete-serverless-dir-on-backports.yml | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/delete-serverless-dir-on-backports.yml diff --git a/.github/workflows/delete-serverless-dir-on-backports.yml b/.github/workflows/delete-serverless-dir-on-backports.yml new file mode 100644 index 0000000000..766c59e0c7 --- /dev/null +++ b/.github/workflows/delete-serverless-dir-on-backports.yml @@ -0,0 +1,34 @@ +name: Delete serverless directory on backports + +on: + pull_request: + branches-ignore: + - 'main' + +jobs: + check-and-delete-serverless: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Check for existence of docs/en/serverless directory + id: check_serverless + run: | + if [ -d "docs/en/serverless" ]; then + echo "SERVERLESS_EXISTS=true" >> $GITHUB_ENV + else + echo "SERVERLESS_EXISTS=false" >> $GITHUB_ENV + fi + + - name: Delete docs/en/serverless directory if it exists + if: env.SERVERLESS_EXISTS == 'true' + run: | + rm -rf docs/en/serverless + git config --global user.name 'github-actions[bot]' + git config --global user.email 'github-actions[bot]@users.noreply.github.com' + git add . + git commit -m "Delete docs/en/serverless directory" + git pull origin ${{ github.head_ref }} + git push origin HEAD:${{ github.head_ref }} \ No newline at end of file From 435f454c6a9f0068900813f3693e792cb1c7d58f Mon Sep 17 00:00:00 2001 From: Brandon Morelli Date: Wed, 22 May 2024 12:04:34 -0700 Subject: [PATCH 2/5] Update delete-serverless-dir-on-backports.yml --- .github/workflows/delete-serverless-dir-on-backports.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/delete-serverless-dir-on-backports.yml b/.github/workflows/delete-serverless-dir-on-backports.yml index 766c59e0c7..3b6aca26e2 100644 --- a/.github/workflows/delete-serverless-dir-on-backports.yml +++ b/.github/workflows/delete-serverless-dir-on-backports.yml @@ -1,4 +1,4 @@ -name: Delete serverless directory on backports +name: Delete serverless directory in backports on: pull_request: @@ -26,9 +26,10 @@ jobs: if: env.SERVERLESS_EXISTS == 'true' run: | rm -rf docs/en/serverless + git config pull.rebase true git config --global user.name 'github-actions[bot]' git config --global user.email 'github-actions[bot]@users.noreply.github.com' git add . git commit -m "Delete docs/en/serverless directory" git pull origin ${{ github.head_ref }} - git push origin HEAD:${{ github.head_ref }} \ No newline at end of file + git push origin HEAD:${{ github.head_ref }} From 4b0d87601fbce5cbed6d1737db087d048217b9a9 Mon Sep 17 00:00:00 2001 From: Brandon Morelli Date: Wed, 22 May 2024 12:19:41 -0700 Subject: [PATCH 3/5] Update .github/workflows/delete-serverless-dir-on-backports.yml --- .github/workflows/delete-serverless-dir-on-backports.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/delete-serverless-dir-on-backports.yml b/.github/workflows/delete-serverless-dir-on-backports.yml index 3b6aca26e2..044d427035 100644 --- a/.github/workflows/delete-serverless-dir-on-backports.yml +++ b/.github/workflows/delete-serverless-dir-on-backports.yml @@ -2,6 +2,9 @@ name: Delete serverless directory in backports on: pull_request: + branches: + - '7.*' + - '8.*' branches-ignore: - 'main' From 1b4ac6962ccdcdd3b44fe3ac84b450c85d4aaff3 Mon Sep 17 00:00:00 2001 From: Brandon Morelli Date: Wed, 22 May 2024 12:20:56 -0700 Subject: [PATCH 4/5] Update .github/workflows/delete-serverless-dir-on-backports.yml --- .github/workflows/delete-serverless-dir-on-backports.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/delete-serverless-dir-on-backports.yml b/.github/workflows/delete-serverless-dir-on-backports.yml index 044d427035..d2f1aa5244 100644 --- a/.github/workflows/delete-serverless-dir-on-backports.yml +++ b/.github/workflows/delete-serverless-dir-on-backports.yml @@ -5,8 +5,6 @@ on: branches: - '7.*' - '8.*' - branches-ignore: - - 'main' jobs: check-and-delete-serverless: From 9a91aa27526579daf73597a1969066f14c6e62e1 Mon Sep 17 00:00:00 2001 From: bmorelli25 Date: Mon, 17 Jun 2024 06:27:17 -0700 Subject: [PATCH 5/5] add to readme --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 908e5cc331..dcba98a5f3 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,10 @@ All documentation pull requests automatically add the **[@obs-docs](https://gith Pull requests should be tagged with the target version of the Elastic Stack along with any relevant backport labels. In general, we only backport documentation changes to [live stack versions](https://github.com/elastic/docs/blob/master/conf.yaml#L74). For manual backports, we recommend using the [backport tool](https://github.com/sqren/backport) to easily open backport PRs. If you need help, ping **[@obs-docs](https://github.com/orgs/elastic/teams/obs-docs)** and we'd be happy to handle the backport process for you. +### Serverless backports + +Serverless content lives in the `serverless` dir. This content is not backported as it is not versioned. If you're backporting Serverless and Stateful content in the same PR, an automation will run that deletes the `docs/en/serverless` dir from your PR. + ## Build