Bin
2025-12-17 1d710f844b65d9bfdf986a71a3b924cd70598a41
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
name: Apply linters
 
on:
  workflow_call:
    inputs:
      branch_name:
        required: true
        type: string
  workflow_dispatch:
    inputs:
      branch_name:
        description: 'Branch Name'
        required: true
        type: string
 
env:
  NODE: "22"
  FRONTEND_MONOREPO_DIR: "web"
 
jobs:
  lint:
    name: "Apply linters"
    runs-on: ubuntu-latest
    steps:
      - uses: hmarr/debug-action@v3.0.0
 
      - name: Add Workflow link to chat ops command comment
        if: github.event.client_payload.github.payload.comment.id && github.event.client_payload.github.payload.repository.full_name
        uses: peter-evans/create-or-update-comment@v5
        with:
          token: ${{ secrets.GIT_PAT }}
          repository: ${{ github.event.client_payload.github.payload.repository.full_name }}
          comment-id: ${{ github.event.client_payload.github.payload.comment.id }}
          body: |
            > [Workflow run](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})
 
      - name: Checkout
        uses: actions/checkout@v6
        with:
          token: ${{ secrets.GIT_PAT }}
          ref: ${{ inputs.branch_name }}
          repository: "${{ github.event.client_payload.pull_request.head.repo.full_name || github.repository }}"
 
      - name: Checkout Actions Hub
        uses: actions/checkout@v6
        with:
          token: ${{ secrets.GIT_PAT }}
          repository: HumanSignal/actions-hub
          path: ./.github/actions-hub
 
      - name: Team details
        id: team_details
        uses: ./.github/actions-hub/actions/team-details
        with:
          jira-server: "${{ vars.JIRA_SERVER }}"
          jira-username: "${{ secrets.JIRA_USERNAME }}"
          jira-token: "${{ secrets.JIRA_TOKEN }}"
          github_token: "${{ secrets.GIT_PAT }}"
        continue-on-error: true
 
      - name: Git Configure
        uses: ./.github/actions-hub/actions/git-configure
        with:
          username: "${{ steps.team_details.outputs.github-username }}"
 
      - name: Set up Python
        uses: actions/setup-python@v6
        with:
          python-version: '3.13'
 
      - name: Install pre-commit
        run: |
          python -m pip install --upgrade pip
          pip install pre-commit
 
      - name: Setup frontend environment
        uses: ./.github/actions/setup-frontend-environment
        with:
          node-version: "${{ env.NODE }}"
          directory: "${{ env.FRONTEND_MONOREPO_DIR }}"
 
      - name: Run formatters
        run: make fmt-all || true
 
      - name: Ensure no lint remains
        run: make fmt-all
 
      - name: Commit changes
        env:
          COMMIT_MESSAGE: "Apply pre-commit linters"
          COMMIT_MESSAGE_WORKFLOW_LINK: "Workflow run: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
        run: |
          git add .
          git commit --allow-empty -m "${COMMIT_MESSAGE}" -m "${COMMIT_MESSAGE_WORKFLOW_LINK}"
 
      - name: Git Push
        id: push
        uses: ./.github/actions-hub/actions/git-push
 
      - name: Add reaction to chat ops command comment
        if: always() && github.event.client_payload.github.payload.comment.id && github.event.client_payload.github.payload.repository.full_name
        uses: peter-evans/create-or-update-comment@v5
        with:
          token: ${{ secrets.GIT_PAT }}
          repository: ${{ github.event.client_payload.github.payload.repository.full_name }}
          comment-id: ${{ github.event.client_payload.github.payload.comment.id }}
          reactions: ${{ job.status == 'success' && '+1' || '-1' }}