-
Notifications
You must be signed in to change notification settings - Fork 247
Workflows
The repository contains several workflows used to automate some specific tasks either by event (push) or on a schedule. For example, we use a test workflow for unit testing, which runs whenever a pull request is opened or updated.
All workflow settings are written in .yml files, and are are stored in .github/workflows, which is a location used by Github to load and configure actions on the repository.
- Log in as a repository administrator.
- Navigate to
Settings>Actionsand tickAllow all actions. - Navigate to
Settings>Branches>Branch protection rulesand selectAdd rule. - Under
Branch name pattern, enterdevor the name of your active branch. - Under
Protect matching branches, tickRequire status checks to pass before merging. - Under
Status checks found for this repositorytickCodeand all checks beginning withMaps. - Save changes.
Due to branch protection preventing automatic pushing of commits to the dev branch, the workflows use a bot account with administrator privileges to generate and push the changelog commits in make_changelogs.yml and changelog_generation.yml. This requires some configuration to get working.
- Create a bot user and email.
- Add the bot to the repository as an administrator under
Settings>Manage access.Adminis necessary for the bot to function. - Log into the bot account and accept the invitation.
- Generate a personal access token with full
repopermissions for the bot user. Keep this handy as you can't view it again after the initial creation, losing it means you need to make a new one. - Navigate to
Settings>Secretson the repository. - Create
BOT_NAMEcontaining the bot account name. - Create
BOT_EMAILcontaining the bot email address. - Create
BOT_TOKENcontaining the personal access token. - Optionally, create
WEBHOOK_URLcontaining a Discord webhook endpoint to report CI failure when thetestworkflow runs.
Here is list of the workflows in the repository at time of writing, along with a description of their function and some instructions on how to configure them. If you add a new workflow, please update this list.
1. test.yml
This workflow runs on pull requests (opened or updated) and conducts CI and unit testing for each configure map. If enabled, this workflow must pass for a PR to be mergable without admin overrides.
Other than the webhook secret setup detailed under Configuring the changelog bot, this one doesn't require specific setup and should work as soon as workflows are enabled on the repository.
This workflow creates a new .yml file in html/changelogs based on the body of a merged pull request. Refer to the pull request template for specific syntax.
Refer to Configuring the changelog bot for necessary setup for this webhook to run.
This workflow runs on a schedule, currently set to once a day, and will compile all .yml files in html/changelogs into a single HTML document that is shown to players when joining the server.
Refer to Configuring the changelog bot for necessary setup for this webhook to run.