Skip to content
Merged
37 changes: 32 additions & 5 deletions .github/workflows/pr-preparation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,42 @@ jobs:

- name: Add snippet
working-directory: changelog/snippets
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
# Priority order as documented in /docs/development-changelog.md
IS_GRAPHICS: "${{ contains(github.event.pull_request.labels.*.name, 'area: graphics') }}"
IS_AI: "${{ contains(github.event.pull_request.labels.*.name, 'area: AI') }}"
# Performance snippet category - no associated label
IS_BALANCE: "${{ contains(github.event.pull_request.labels.*.name, 'area: balance idea') }}"
# Features snippet category - no associated label
IS_OTHER: >
"${{ contains(github.event.pull_request.labels.*.name, 'area: documentation')
|| contains(github.event.pull_request.labels.*.name, 'area: tooling')
}}"
IS_FIX: "${{ contains(github.event.pull_request.labels.*.name, 'type: bug') }}"
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


category="category"
template="sections/template-snippet.md"
if [ "$IS_GRAPHICS" = "true" ]; then
category="graphics"
elif [ "$IS_AI" = "true" ]; then
category="ai"
elif [ "$IS_BALANCE" = "true" ]; then
category="balance"
template="sections/template-snippet-balance.md"
elif [ "$IS_OTHER" = "true" ]; then
category="other"
elif [ "$IS_FIX" = "true" ]; then
category="fix"
fi
file="${category}.${PR_NUMBER}.md"
Comment thread
coderabbitai[bot] marked this conversation as resolved.
cp "$template" "$file"
sed -i "s/PR_NUMBER/${PR_NUMBER}/g" "$file"

git add .
git commit -m "Add snippet template"
git push
Expand Down
6 changes: 6 additions & 0 deletions changelog/snippets/sections/template-snippet-balance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{% unit <BlueprintID> %}
<Formatted Unit Name>
{% endunit %}
<Description> (#PR_NUMBER)
- <Category>:
- <Parameter Name>: <value before> -> <value after>
2 changes: 1 addition & 1 deletion changelog/snippets/sections/template-snippet.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
- Your explanation here... [Don't forget to change the category in the filename] (#XYZW).
- Your explanation here... [Don't forget to change the category in the filename] (#PR_NUMBER).
14 changes: 7 additions & 7 deletions docs/development-changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ The format of a snippet depends on whether it is a [balance snippet](../developm

### Choosing a category

`graphics` is everything graphics related.
`ai` is everything AI related, for example new features that AI modders can use, or new capabilities of the AI.
`performance` is for changes that were made to increase the performance of the game.
`balance` are changes that are made to improve the balance of the game.
`features` is for new features that are available for the players in the game.
`fix` is for fixes of bugs in the game. Bugs regarding intellisense or other areas outside of the game should go into `other`.
`other` Refactors, changes for developers and modders, code annotations and the like fall into this category.
1. `graphics` is everything graphics-related.
2. `ai` is everything AI-related, for example new features that AI modders can use, or new capabilities of the AI.
3. `performance` is for changes that were made to increase the performance of the game.
4. `balance` is for changes that are made to improve the balance of the game.
5. `features` is for new features that are available for the players in the game.
6. `fix` is for fixes of bugs in the game. Bugs regarding IntelliSense or other areas outside the game should go into `other`.
7. `other` is for refactors, changes for developers and modders, and code annotations.

If multiple categories are fitting, use the one that appears first in this list.

Expand Down