diff --git a/.github/workflows/update-translations.yml b/.github/workflows/update-translations.yml index 26d9d3ab..ad47e974 100644 --- a/.github/workflows/update-translations.yml +++ b/.github/workflows/update-translations.yml @@ -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 diff --git a/chameleonultragui/lib/helpers/github.dart b/chameleonultragui/lib/helpers/github.dart index 148c97d4..dd782f64 100644 --- a/chameleonultragui/lib/helpers/github.dart +++ b/chameleonultragui/lib/helpers/github.dart @@ -42,6 +42,8 @@ List> developers = [ }, ]; +List excludedAccounts = ["github-actions[bot]", "ChameleonHelper"]; + Future>> fetchGitHubContributors() async { try { final response = json.decode((await http.get(Uri.parse( @@ -52,7 +54,7 @@ Future>> fetchGitHubContributors() async { if (response is List) { List> 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({