Add Notifications View & Bump Version (#318) #664
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
| name: SwiftLint | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - "**/*.swift" | |
| - "**/*.yml" | |
| pull_request: | |
| branches: | |
| - main | |
| paths: | |
| - "**/*.swift" | |
| - "**/*.yml" | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| jobs: | |
| SwiftLint: | |
| name: Lint with swiftlint, fail if any errors | |
| runs-on: macos-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install SwiftLint | |
| run: | | |
| brew install swiftlint | |
| - name: Run SwiftLint | |
| run: | | |
| swiftlint lint --strict --quiet --reporter github-actions-logging | |
| label-swiftlint-status: | |
| needs: SwiftLint | |
| if: always() && github.event_name == 'pull_request' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Add swiftlint-pass label if lint succeeded | |
| if: ${{ needs.SwiftLint.result == 'success' }} | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| github.rest.issues.addLabels({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.issue.number, | |
| labels: ['swiftlint-pass'] | |
| }) | |
| await github.rest.issues.removeLabel({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.issue.number, | |
| name: 'swiftlint-fail' | |
| }).catch(e => { | |
| if (e.status !== 404) throw e | |
| }) | |
| - name: Add swiftlint-fail label if lint failed | |
| if: ${{ needs.SwiftLint.result == 'failure' }} | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| github.rest.issues.addLabels({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.issue.number, | |
| labels: ['swiftlint-fail'] | |
| }) | |
| await github.rest.issues.removeLabel({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.issue.number, | |
| name: 'swiftlint-pass' | |
| }).catch(e => { | |
| if (e.status !== 404) throw e | |
| }) |