Skip to content

Commit

Permalink
Use helper account for translations updates (#310)
Browse files Browse the repository at this point in the history
  • Loading branch information
Foxushka authored Oct 10, 2023
1 parent 3758a33 commit effa6aa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/update-translations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,10 @@ jobs:
if: steps.git-check.outputs.has_changes == 'true'
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
token: ${{ secrets.BOT_HELPER_TOKEN }}
base: main
branch: translations-branch
commit-message: "New translations fetched from Crowdin"
push-to-fork: ChameleonHelper/ChameleonUltraGUI
body: "Update translations"
title: "feat: Update translations"
delete-branch: true
4 changes: 3 additions & 1 deletion chameleonultragui/lib/helpers/github.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ List<Map<String, String>> developers = [
},
];

List<String> excludedAccounts = ["github-actions[bot]", "ChameleonHelper"];

Future<List<Map<String, String>>> fetchGitHubContributors() async {
try {
final response = json.decode((await http.get(Uri.parse(
Expand All @@ -52,7 +54,7 @@ Future<List<Map<String, String>>> fetchGitHubContributors() async {
if (response is List) {
List<Map<String, String>> contributors = [];
for (var contributor in response) {
if (contributor['login'] != 'github-actions[bot]' &&
if (!excludedAccounts.contains(contributor['login']) &&
!developers.any(
(developer) => developer['username'] == contributor['login'])) {
contributors.add({
Expand Down

0 comments on commit effa6aa

Please sign in to comment.