Skip to content

Commit

Permalink
Gives fulp its own changelog files (...again) (fulpstation#1306)
Browse files Browse the repository at this point in the history
* Makes fulp changelogs real

* Update tg_edits.md

* I guess it should have a description too

* Misplaced

* Updates and changes

* Changes these things again

* Replaces additional file with a TG edit

* Wording

* Removes example.yml

* Adds a small .md file instead

* Sorry, has to be on archive.
  • Loading branch information
FernandoJ8 authored Jan 13, 2025
1 parent 8f518a0 commit 36274f3
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 7 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/compile_changelogs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,16 @@ jobs:
permissions:
contents: write
steps:
- name: "Check for ACTION_ENABLER secret and pass true to output if it exists to be checked by later steps"
# Fulp Edit - Replaces ACTION_ENABLER with ACTION_ENABLER_FULP
- name: "Check for ACTION_ENABLER_FULP secret and pass true to output if it exists to be checked by later steps" # Here
id: value_holder
env:
ENABLER_SECRET: ${{ secrets.ACTION_ENABLER }}
ENABLER_SECRET: ${{ secrets.ACTION_ENABLER_FULP }} # Here
# Fulp Edit End
run: |
unset SECRET_EXISTS
if [ -n "$ENABLER_SECRET" ]; then SECRET_EXISTS=true ; fi
echo "ACTIONS_ENABLED=$SECRET_EXISTS" >> $GITHUB_OUTPUT
- name: "Setup python"
if: steps.value_holder.outputs.ACTIONS_ENABLED
uses: actions/setup-python@v5
Expand All @@ -43,18 +44,19 @@ jobs:

- name: "Compile"
if: steps.value_holder.outputs.ACTIONS_ENABLED
# Fulp Edit - Replaces html/changelogs with fulp_modules/data/html/changelogs
run: |
python tools/ss13_genchangelog.py html/changelogs
python tools/ss13_genchangelog.py fulp_modules/data/html/changelogs
- name: Commit
if: steps.value_holder.outputs.ACTIONS_ENABLED
run: |
git config --local user.name "tgstation-ci[bot]"
git config --local user.email "179393467+tgstation-ci[bot]@users.noreply.github.com"
git pull origin master
git add html/changelogs
git add fulp_modules/data/html/changelogs
git commit -m "Automatic changelog compile [ci skip]" -a || true
# Fulp Edit End
- name: Generate App Token
id: app-token-generation
uses: actions/create-github-app-token@v1
Expand Down
9 changes: 9 additions & 0 deletions fulp_modules/data/html/changelogs/archive/changelogs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Changelogs

When a PR is merged, a corresponding changelog file is created in `fulp_modules/data/html/changelogs`. Those files are then collected together, monthly, and saved here for long term preservation. TG does this too, in their `html/changelogs` folder.

## Writing a changelog

While, technically, you can write a changelog by hand, there's no reason to do so. For a very long time now, the process of creating and formatting changelog files has been automated through github actions.

All that you need to do is to fill out the "Changelog" section of your PR while following the indicated format.
4 changes: 4 additions & 0 deletions fulp_modules/tg_edits.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@

- tgstation.dme > Adds our files to be included when compiling

- tools/pull_request_hooks/autoChangelog.js > Changes changelog folder to fulp_modules/data/html/changelogs, to preserve them across TGUs.

- .github\workflows\compile_changelogs.yml > Same as above.

## All Fulp files not contained within /fulp_modules/

- code/__DEFINES/fulp_defines > Contains all of our defines
Expand Down
4 changes: 3 additions & 1 deletion tools/pull_request_hooks/autoChangelog.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ export async function processAutoChangelog({ github, context }) {
github.rest.repos.createOrUpdateFileContents({
owner: context.repo.owner,
repo: context.repo.repo,
path: `html/changelogs/AutoChangeLog-pr-${context.payload.pull_request.number}.yml`,
// Fulp Edit: Changes the path to our changelog folder (html/changelogs/... -> fulp_modules/data/html/changelogs...)
path: `fulp_modules/data/html/changelogs/AutoChangeLog-pr-${context.payload.pull_request.number}.yml`,
// Fulp Edit End
message: `Automatic changelog for PR #${context.payload.pull_request.number} [ci skip]`,
content: Buffer.from(yml).toString("base64"),
});
Expand Down

0 comments on commit 36274f3

Please sign in to comment.