From 6a147b7046696589bea0e9a593720dcef2ed13bf Mon Sep 17 00:00:00 2001 From: BlackYps Date: Fri, 10 Apr 2026 21:03:08 +0200 Subject: [PATCH 1/5] Add snippet to new PRs --- .github/workflows/auto-draft-pr.yaml | 28 +++++++++++++++++-- .../snippets/sections/template-snippet.md | 1 + 2 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 changelog/snippets/sections/template-snippet.md diff --git a/.github/workflows/auto-draft-pr.yaml b/.github/workflows/auto-draft-pr.yaml index 2de9158a170..16a561d1329 100644 --- a/.github/workflows/auto-draft-pr.yaml +++ b/.github/workflows/auto-draft-pr.yaml @@ -18,7 +18,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -name: Convert PRs to Draft on Opening +name: Pull Request preparation permissions: contents: write @@ -28,10 +28,32 @@ on: types: [opened] jobs: - convert_to_draft: + prepare_pr: + name: Prepare pull request runs-on: ubuntu-latest steps: - - run: gh pr ready --undo ${{ github.event.pull_request.number }} + - name: Checkout branch + uses: actions/checkout@v6 + with: + ssh-key: ${{ secrets.SSH_FAFOREVER_MACHINE_USER }} + + - name: Add snippet + working-directory: changelog/snippets + run: | + # Configure git + git config user.email "github@faforever.com" + git config user.name "FAForever Machine User" + + FILE=category.${{ github.event.pull_request.number }}.md + cp sections/template-snippet.md $FILE + sed -i "s/XYZW/${{ github.event.pull_request.number }}/g" $FILE + + git add . + git commit -m "Add snippet template" + git push + + - name: Convert PR to draft + run: gh pr ready --undo ${{ github.event.pull_request.number }} env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} GH_REPO: ${{ github.repository }} diff --git a/changelog/snippets/sections/template-snippet.md b/changelog/snippets/sections/template-snippet.md new file mode 100644 index 00000000000..6dd6508f92e --- /dev/null +++ b/changelog/snippets/sections/template-snippet.md @@ -0,0 +1 @@ +- Your explanation here... [Don't forget to change the category in the filename] (#XYZW). From 5dff7f3e6986cac0db63fc59558d054db4bf27d3 Mon Sep 17 00:00:00 2001 From: BlackYps Date: Mon, 18 May 2026 00:46:02 +0200 Subject: [PATCH 2/5] Run pr preparation only on local branches --- .github/workflows/{auto-draft-pr.yaml => pr-preparation.yaml} | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) rename .github/workflows/{auto-draft-pr.yaml => pr-preparation.yaml} (96%) diff --git a/.github/workflows/auto-draft-pr.yaml b/.github/workflows/pr-preparation.yaml similarity index 96% rename from .github/workflows/auto-draft-pr.yaml rename to .github/workflows/pr-preparation.yaml index 16a561d1329..a005395bb46 100644 --- a/.github/workflows/auto-draft-pr.yaml +++ b/.github/workflows/pr-preparation.yaml @@ -20,9 +20,6 @@ name: Pull Request preparation -permissions: - contents: write - on: pull_request: types: [opened] @@ -30,6 +27,7 @@ on: jobs: prepare_pr: name: Prepare pull request + if: ${{ github.event.pull_request.head.repo.full_name == github.repository }} runs-on: ubuntu-latest steps: - name: Checkout branch From bf49277876f1aa6b4efe30c3998bd36386bac280 Mon Sep 17 00:00:00 2001 From: BlackYps Date: Mon, 18 May 2026 00:47:48 +0200 Subject: [PATCH 3/5] Checkout pr branch correctly --- .github/workflows/pr-preparation.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr-preparation.yaml b/.github/workflows/pr-preparation.yaml index a005395bb46..846ad718ca7 100644 --- a/.github/workflows/pr-preparation.yaml +++ b/.github/workflows/pr-preparation.yaml @@ -30,9 +30,10 @@ jobs: if: ${{ github.event.pull_request.head.repo.full_name == github.repository }} runs-on: ubuntu-latest steps: - - name: Checkout branch + - name: Checkout PR branch uses: actions/checkout@v6 with: + ref: ${{ github.event.pull_request.head.ref }} ssh-key: ${{ secrets.SSH_FAFOREVER_MACHINE_USER }} - name: Add snippet From 87289e8c3d67a5066af87a8cedaacb3315868197 Mon Sep 17 00:00:00 2001 From: FAForever Machine User Date: Sun, 17 May 2026 23:26:04 +0000 Subject: [PATCH 4/5] Add snippet template --- changelog/snippets/category.7125.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog/snippets/category.7125.md diff --git a/changelog/snippets/category.7125.md b/changelog/snippets/category.7125.md new file mode 100644 index 00000000000..aabff52c1a5 --- /dev/null +++ b/changelog/snippets/category.7125.md @@ -0,0 +1 @@ +- Your explanation here... [Don't forget to change the category in the filename] (#7125). From e83d365f640a23d229cac5531d6ce0e8eeb91c65 Mon Sep 17 00:00:00 2001 From: BlackYps Date: Mon, 18 May 2026 01:30:44 +0200 Subject: [PATCH 5/5] remove snippet as this doesn't affect the players --- changelog/snippets/category.7125.md | 1 - 1 file changed, 1 deletion(-) delete mode 100644 changelog/snippets/category.7125.md diff --git a/changelog/snippets/category.7125.md b/changelog/snippets/category.7125.md deleted file mode 100644 index aabff52c1a5..00000000000 --- a/changelog/snippets/category.7125.md +++ /dev/null @@ -1 +0,0 @@ -- Your explanation here... [Don't forget to change the category in the filename] (#7125).