diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 7fcddcb18..e525707ca 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -2,5 +2,4 @@ * @mozilla-l10n/l10n-firefox # Code reviewers (workflows, scripts) -/_scripts/ @mozilla-l10n/l10n-firefox @eemeli /.github/ @mozilla-l10n/l10n-firefox @eemeli diff --git a/_scripts/diff.py b/.github/scripts/diff.py similarity index 100% rename from _scripts/diff.py rename to .github/scripts/diff.py diff --git a/_scripts/prune.py b/.github/scripts/prune.py similarity index 97% rename from _scripts/prune.py rename to .github/scripts/prune.py index 77da3e48c..7a0b84911 100644 --- a/_scripts/prune.py +++ b/.github/scripts/prune.py @@ -104,11 +104,11 @@ def write_commit_msg(data: list[str], files: int, messages: int): if __name__ == "__main__": - prog = "python -m _scripts.prune" + prog = "python .github/scripts/prune.py" parser = ArgumentParser(prog=prog, description=__doc__) args = parser.parse_args() - config_file = join("_configs", "config.json") + config_file = join(".github", "update-config.json") with open(config_file) as f: cfg_automation = json.load(f) diff --git a/_scripts/requirements.txt b/.github/scripts/requirements.txt similarity index 100% rename from _scripts/requirements.txt rename to .github/scripts/requirements.txt diff --git a/_scripts/update.py b/.github/scripts/update.py similarity index 98% rename from _scripts/update.py rename to .github/scripts/update.py index f6d8a2ba2..06faa9c80 100644 --- a/_scripts/update.py +++ b/.github/scripts/update.py @@ -173,11 +173,11 @@ def write_commit_msg(args, new_files: int, updated_files: int): if __name__ == "__main__": - config_file = join("_configs", "config.json") + config_file = join(".github", "update-config.json") with open(config_file) as f: cfg_automation = json.load(f) - prog = "python -m _scripts.update" + prog = "python .github/scripts/update.py" parser = ArgumentParser( prog=prog, description=__doc__.format(HEAD=cfg_automation["head"]), diff --git a/_configs/config.json b/.github/update-config.json similarity index 100% rename from _configs/config.json rename to .github/update-config.json diff --git a/.github/workflows/cmp_geckostrings.yml b/.github/workflows/cmp_geckostrings.yml index a79cab708..cdd63f256 100644 --- a/.github/workflows/cmp_geckostrings.yml +++ b/.github/workflows/cmp_geckostrings.yml @@ -31,12 +31,12 @@ jobs: with: python-version: "3.12" cache: pip - cache-dependency-path: l10n/_scripts/requirements.txt - - run: pip install -r l10n/_scripts/requirements.txt + cache-dependency-path: l10n/.github/scripts/requirements.txt + - run: pip install -r l10n/.github/scripts/requirements.txt - name: Compare content run: | - diff=$(python l10n/_scripts/diff.py l10n gecko-strings --ignore LICENSE README.md || true) + diff=$(python l10n/.github/scripts/diff.py l10n gecko-strings --ignore LICENSE README.md || true) if [[ -n "$diff" ]]; then echo "### There are differences between the two repositories" >> $GITHUB_STEP_SUMMARY echo '```' >> $GITHUB_STEP_SUMMARY diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml index 60a9af709..3300a4a55 100644 --- a/.github/workflows/update.yml +++ b/.github/workflows/update.yml @@ -29,14 +29,14 @@ jobs: id: config run: | # Store the list of branches as a JSON array - echo "branches=$(jq -c '.branches' < _configs/config.json)" >> "$GITHUB_OUTPUT" + echo "branches=$(jq -c '.branches' < .github/update-config.json)" >> "$GITHUB_OUTPUT" # Store the list of paths as a multiline list # Bash multiline version # https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#multiline-strings { echo 'paths<> "$GITHUB_OUTPUT" update: @@ -62,10 +62,10 @@ jobs: with: python-version: "3.12" cache: pip - cache-dependency-path: l10n/_scripts/requirements.txt - - run: pip install -r l10n/_scripts/requirements.txt + cache-dependency-path: l10n/.github/scripts/requirements.txt + - run: pip install -r l10n/.github/scripts/requirements.txt - run: > - python -m _scripts.update + python .github/scripts/update.py --branch ${{ matrix.ref }} --commit $(cd ../firefox && git rev-parse --short HEAD) --firefox ../firefox @@ -92,9 +92,9 @@ jobs: with: python-version: "3.12" cache: pip - cache-dependency-path: _scripts/requirements.txt - - run: pip install -r _scripts/requirements.txt - - run: python -m _scripts.prune + cache-dependency-path: .github/scripts/requirements.txt + - run: pip install -r .github/scripts/requirements.txt + - run: python .github/scripts/prune.py - name: git config run: | git config --global user.name "github-actions[bot]"