|
1 | | -# clean-up |
| 1 | +# π§Ή clean-up |
| 2 | + |
| 3 | +**A GitHub Action to automate the cleanup of stale branches in your repositories.** |
| 4 | + |
| 5 | +This action identifies and deletes local Git branches that have been removed from the remote, helping maintain a tidy and up-to-date translation repository. |
| 6 | + |
| 7 | +--- |
| 8 | + |
| 9 | +## βοΈ Basic example |
| 10 | + |
| 11 | +To integrate the `clean-up` action into your workflow, add the following to your `.github/workflows/clean_up.yml` file. |
| 12 | +Here is an example for the numpy.org translations repo. |
| 13 | + |
| 14 | +```yaml |
| 15 | +name: Clean Up |
| 16 | + |
| 17 | +on: |
| 18 | + schedule: |
| 19 | + - cron: "0 3 * * 0" # Runs every Sunday at 3 AM |
| 20 | + workflow_dispatch: |
| 21 | + |
| 22 | +jobs: |
| 23 | + build: |
| 24 | + runs-on: ubuntu-latest |
| 25 | + steps: |
| 26 | + - name: Clean up |
| 27 | + uses: Scientific-Python-Translations/clean-up@main |
| 28 | + env: |
| 29 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 30 | + with: |
| 31 | + # Provided by user |
| 32 | + translations-repo: "Scientific-Python-Translations/numpy.org-translations" |
| 33 | + translations-ref: "main" |
| 34 | + # Provided by organization secrets |
| 35 | + gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} |
| 36 | + passphrase: ${{ secrets.PASSPHRASE }} |
| 37 | + token: "not-a-real-token" |
| 38 | + crowdin-token: ${{ secrets.CROWDIN_TOKEN }} |
| 39 | +``` |
| 40 | +
|
| 41 | +This configuration schedules the cleanup to run weekly and also allows manual triggering. |
| 42 | +
|
| 43 | +## π οΈ Inputs |
| 44 | +
|
| 45 | +| Input | Required | Default | Description | |
| 46 | +| ------------------- | -------- | ------- | ---------------------------------------------------------- | |
| 47 | +| `translations-repo` | β
| β | The GitHub repository to sync the translated content into. | |
| 48 | +| `translations-ref` | β | `main` | The branch in the translations repository to sync into. | |
| 49 | + |
| 50 | +## π€ Bot Activity |
| 51 | + |
| 52 | +All synchronization pull requests and automated commits are performed by the dedicated bot account: |
| 53 | +[@scientificpythontranslations](https://github.com/scientificpythontranslations) |
| 54 | + |
| 55 | +This ensures consistent and traceable contributions from a centralized automation identity. |
| 56 | +If you need to grant permissions or configure branch protection rules, make sure to allow actions and PRs from this bot. |
| 57 | + |
| 58 | +## π Community & Support |
| 59 | + |
| 60 | +- Join the [Scientific Python Discord](https://scientific-python.org/community/) and visit the `#translation` channel |
| 61 | +- Browse the [Scientific Python Translations documentation](https://scientific-python-translations.github.io/docs/) |
| 62 | +- Visit the [content-sync](https://github.com/Scientific-Python-Translations/content-sync) and [translations-sync](https://github.com/Scientific-Python-Translations/translations-sync) Github actions. |
| 63 | + |
| 64 | +## π€ Contributing |
| 65 | + |
| 66 | +Contributions are welcome! Please open an issue or submit a pull request for any enhancements or bug fixes. |
| 67 | + |
| 68 | +## π License |
| 69 | + |
| 70 | +This project is licensed under the [MIT License](LICENSE.txt). |
0 commit comments