format #533
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This workflow is used to format the code in the repository. | |
| name: format | |
| on: | |
| workflow_dispatch: # manual trigger | |
| schedule: | |
| # ┌───────────── minute (0 - 59) | |
| # │ ┌───────────── hour (0 - 23) | |
| # │ │ ┌───────────── day of the month (1 - 31) | |
| # │ │ │ ┌───────────── month (1 - 12 or JAN-DEC) | |
| # │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT) | |
| # │ │ │ │ │ | |
| # * * * * * | |
| - cron: "0 15 * * *" # every day at 15:00 UTC (7:00 PST, 8:00 PDT) | |
| env: | |
| TERM: xterm-256color | |
| DEVELOPER_DIR: /Applications/Xcode_${{ vars.XCODE_VERSION }}.app/Contents/Developer | |
| jobs: | |
| format: | |
| name: Format | |
| strategy: | |
| fail-fast: false | |
| timeout-minutes: 5 | |
| runs-on: ${{ vars.MACOS }} | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v4 | |
| - name: Bootstrap | |
| uses: ./.github/actions/bootstrap | |
| - name: Format | |
| run: make format | |
| - name: Lint | |
| run: make lint | |
| - name: Revert Package.resolved changes # bootstrap may update Package.resolved, ignore the changes | |
| run: | | |
| git checkout HEAD -- "**/Package.resolved" || true | |
| - name: Create Pull Request | |
| if: success() || failure() | |
| uses: peter-evans/create-pull-request@v6 | |
| with: | |
| token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | |
| commit-message: "[format] format code" | |
| committer: "Honghao Zhang <3926785+honghaoz@users.noreply.github.com>" | |
| author: "Honghao Zhang <3926785+honghaoz@users.noreply.github.com>" | |
| title: "[format] format code" | |
| body: "This PR was automatically created by the [format](https://github.com/honghaoz/ChouTiUI/actions/workflows/format.yml) workflow." | |
| branch: "github-actions/format" | |
| draft: false | |
| delete-branch: true | |
| add-paths: | | |
| !**/Package.resolved |