Repository navigation
46 lines (45 loc) · 1.96 KB
/
Copy pathupdate_pre_commit.yml
File metadata and controls
46 lines (45 loc) · 1.96 KB
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
name: Update pre-commit to latest
on:
workflow_call:
jobs:
update_pre_commit_config:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
ref: "v2"
repository: ForesightMiningSoftwareCorporation/github
- id: generate_token
name: Generate token
uses: tibdex/github-app-token@v2.1.0
with:
app_id: ${{ secrets.FMSC_BOT_GITHUB_APP_ID }}
private_key: ${{ secrets.FMSC_BOT_GITHUB_APP_PRIVATE_KEY }}
- name: Install Updatecli in the runner
uses: updatecli/updatecli-action@v2
- name: Extract branch name
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch
- name: Run UpdateCli to update pre-commit in diff mode
shell: bash
working-directory: ${{ inputs.working-directory }}
run: |
updatecli diff --config updatecli/updatecli.d/ci/pre-commit.yml --values updatecli/values.github-action.yaml || true
env:
UPDATECLI_GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
UPDATECLI_GITHUB_ACTOR: ${{ github.actor }}
UPDATECLI_BRANCH: ${{ steps.extract_branch.outputs.branch }}
UPDATECLI_REPO: ${{ github.event.repository.name }}
- name: Run UpdateCli to update pre-commit in apply mode
shell: bash
working-directory: ${{ inputs.working-directory }}
if: ${{ steps.extract_branch.outputs.branch == github.event.repository.default_branch }}
run: |
updatecli apply --config updatecli/updatecli.d/ci/pre-commit.yml --values updatecli/values.github-action.yaml || true
env:
UPDATECLI_GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
UPDATECLI_GITHUB_ACTOR: ${{ github.actor }}
UPDATECLI_BRANCH: ${{ steps.extract_branch.outputs.branch }}
UPDATECLI_REPO: ${{ github.event.repository.name }}