└── workflow-templates ├── swiftlint.properties.json ├── swiftformat.properties.json ├── auto-author-assign.properties.json ├── rebase-default-branch.properties.json ├── dependent-issues.properties.json ├── conventional-commit.properties.json ├── auto-author-assign.yml ├── swiftformat.yml ├── swiftlint.yml ├── dependent-issues.yml ├── conventional-commit.yml └── rebase-default-branch.yml /workflow-templates/swiftlint.properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "SwiftLint", 3 | "description": "Default linting for iOS projects", 4 | "iconName": "octicon file-code", 5 | "categories": [ 6 | "Swift" 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /workflow-templates/swiftformat.properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "SwiftFormat", 3 | "description": "Default formatting for iOS projects", 4 | "iconName": "octicon file-code", 5 | "categories": [ 6 | "Swift" 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /workflow-templates/auto-author-assign.properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Auto assign PR author", 3 | "description": "Automatically add author to PR", 4 | "iconName": "octicon person-add", 5 | "categories": [ 6 | "code-review" 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /workflow-templates/rebase-default-branch.properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Auto-Rebase", 3 | "description": "Automatically rebase labeled PRs", 4 | "iconName": "octicon git-merge-queue", 5 | "categories": [ 6 | "code-review" 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /workflow-templates/dependent-issues.properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Dependent issues", 3 | "description": "Prevent merging before dependent issues are merged", 4 | "iconName": "octicon git-branch", 5 | "categories": [ 6 | "code-review" 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /workflow-templates/conventional-commit.properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Conventional Commits and PRs titles", 3 | "description": "Default check for commits messages and PR titles", 4 | "iconName": "octicon discussion-closed", 5 | "categories": [ 6 | "code-review" 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /workflow-templates/auto-author-assign.yml: -------------------------------------------------------------------------------- 1 | name: Auto Author Assign 2 | 3 | on: 4 | pull_request_target: 5 | types: [ opened, reopened ] 6 | 7 | permissions: 8 | pull-requests: write 9 | 10 | jobs: 11 | assign-author: 12 | runs-on: ubuntu-latest 13 | steps: 14 | - uses: toshimaru/auto-author-assign@v2.1.0 15 | -------------------------------------------------------------------------------- /workflow-templates/swiftformat.yml: -------------------------------------------------------------------------------- 1 | name: SwiftFormat 2 | 3 | on: 4 | pull_request: 5 | branches: [ $default-branch ] 6 | 7 | jobs: 8 | build: 9 | name: SwiftFormat 10 | runs-on: [ self-hosted, iOS ] 11 | 12 | steps: 13 | - name: Cancel Previous Runs 14 | uses: styfle/cancel-workflow-action@0.12.1 15 | with: 16 | access_token: ${{ github.token }} 17 | - uses: jdx/mise-action@v2 18 | with: 19 | cache: false 20 | - name: Checkout 21 | uses: actions/checkout@v4 22 | with: 23 | fetch-depth: 0 24 | - name: SwiftFormat 25 | run: swiftformat --lint . --reporter github-actions-log 26 | -------------------------------------------------------------------------------- /workflow-templates/swiftlint.yml: -------------------------------------------------------------------------------- 1 | name: SwiftLint 2 | 3 | on: 4 | pull_request: 5 | branches: [ $default-branch ] 6 | 7 | jobs: 8 | build: 9 | name: SwiftLint 10 | runs-on: [ self-hosted, iOS ] 11 | 12 | steps: 13 | - name: Cancel Previous Runs 14 | uses: styfle/cancel-workflow-action@0.12.1 15 | with: 16 | access_token: ${{ github.token }} 17 | - uses: jdx/mise-action@v2 18 | with: 19 | cache: false 20 | - name: Checkout 21 | uses: actions/checkout@v4 22 | with: 23 | fetch-depth: 0 24 | - name: SwiftLint 25 | run: swiftlint --config .swiftlint.yml --config .swiftlint-ci.yml --reporter github-actions-logging . 26 | -------------------------------------------------------------------------------- /workflow-templates/dependent-issues.yml: -------------------------------------------------------------------------------- 1 | name: Dependent Issues 2 | 3 | on: 4 | issues: 5 | types: 6 | - opened 7 | - edited 8 | - closed 9 | - reopened 10 | pull_request_target: 11 | types: 12 | - opened 13 | - edited 14 | - closed 15 | - reopened 16 | # Makes sure we always add status check for PRs. Useful only if 17 | # this action is required to pass before merging. Otherwise, it 18 | # can be removed. 19 | - synchronize 20 | 21 | jobs: 22 | check: 23 | runs-on: ubuntu-latest 24 | steps: 25 | - uses: z0al/dependent-issues@v1.5.2 26 | env: 27 | # (Required) The token to use to make API calls to GitHub. 28 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 29 | -------------------------------------------------------------------------------- /workflow-templates/conventional-commit.yml: -------------------------------------------------------------------------------- 1 | name: 'PR and Commit Message Check' 2 | on: 3 | pull_request_target: 4 | types: 5 | - opened 6 | - edited 7 | - reopened 8 | - synchronize 9 | 10 | jobs: 11 | check-commit-message: 12 | name: Check Commit Message 13 | runs-on: ubuntu-latest 14 | steps: 15 | - name: Check Commit Message 16 | uses: gsactions/commit-message-checker@v2 17 | with: 18 | pattern: '^(Merge .+|((feat|fix|chore|docs|style|refactor|perf|ci|test)(\(.+\))?: [A-Z0-9].+[^.\s])$)' 19 | error: 'Commit messages and PR title should match conventional commit convention and start with an uppercase.' 20 | excludeDescription: 'true' 21 | excludeTitle: 'false' 22 | checkAllCommitMessages: 'true' 23 | accessToken: ${{ secrets.GITHUB_TOKEN }} 24 | -------------------------------------------------------------------------------- /workflow-templates/rebase-default-branch.yml: -------------------------------------------------------------------------------- 1 | # Rebases a pull request on the repo's default branch when the "rebase" label is added 2 | # Link: https://github.com/Infomaniak/.github/blob/main/workflow-templates/rebase-default-branch.yml 3 | 4 | name: Rebase Pull Request 5 | 6 | on: 7 | pull_request: 8 | types: [ labeled ] 9 | 10 | concurrency: 11 | group: ${{ github.workflow }}-${{ github.ref }} 12 | cancel-in-progress: true 13 | 14 | env: 15 | DEFAULT_BRANCH: ${{ github.event.repository.default_branch }} 16 | 17 | jobs: 18 | main: 19 | if: ${{ contains(github.event.*.labels.*.name, 'rebase') }} 20 | name: Rebase 21 | runs-on: ubuntu-latest 22 | steps: 23 | - name: Checkout 24 | uses: actions/checkout@v5.0.0 25 | with: 26 | ref: ${{ github.event.pull_request.head.ref }} 27 | fetch-depth: 0 28 | 29 | # Context: https://httgp.com/signing-commits-in-github-actions 30 | # Link: https://github.com/crazy-max/ghaction-import-gpg/releases 31 | - name: Import bot's GPG key for signing commits 32 | id: import-gpg 33 | uses: crazy-max/ghaction-import-gpg@e89d40939c28e39f97cf32126055eeae86ba74ec # v6.3.0 34 | with: 35 | gpg_private_key: ${{ secrets.BOT_MOBILE_GPG_PRIVATE_KEY }} 36 | passphrase: ${{ secrets.BOT_MOBILE_GPG_PASSPHRASE }} 37 | git_config_global: true 38 | git_user_signingkey: true 39 | git_commit_gpgsign: true 40 | 41 | - name: perform rebase 42 | run: | 43 | git config --global user.name "dev-mobile-bot" 44 | git config --global user.email "mobile+github-bot@infomaniak-dev.ch" 45 | git status 46 | git pull 47 | git checkout "$DEFAULT_BRANCH" 48 | git status 49 | git pull 50 | git checkout "$GITHUB_HEAD_REF" 51 | git rebase "$DEFAULT_BRANCH" 52 | git push --force-with-lease 53 | git status 54 | 55 | # Context: https://github.com/marketplace/actions/actions-ecosystem-remove-labels 56 | # Link: https://github.com/actions-ecosystem/action-remove-labels/releases 57 | - name: remove label 58 | if: always() 59 | uses: actions-ecosystem/action-remove-labels@2ce5d41b4b6aa8503e285553f75ed56e0a40bae0 # v1.3.0 60 | with: 61 | labels: rebase 62 | --------------------------------------------------------------------------------