-
Notifications
You must be signed in to change notification settings - Fork 44
68 lines (59 loc) · 2.67 KB
/
refresh-checksmd.yml
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
---
name: Checks.md updater
on:
# Compare the preceeding commit of main -> to the current commit of the main branch.
# (Note: To compare changes between the last pushed commit to the remote main branch set `since_last_remote_commit: true`)
push:
branches:
- main
# Compare the last commit of main -> to the current commit of a PR branch.
# (Note: To compare changes between the last pushed commit to the remote PR branch set `since_last_remote_commit: true`)
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest # windows-latest | macos-latest
name: Test changed-files
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # OR "2" -> To retrieve the preceding commit.
- name: Get changed files in the checks folder
id: changed-files-specific
uses: tj-actions/changed-files@v40
with:
files: |
checks/**
info/**
pre/**
ssh/**
- name: Run step if any file(s) in the watched folder change
if: steps.changed-files-specific.outputs.any_changed == 'true'
run: |
echo "One or more files in the scripts folder has changed, updating checks.md"
echo "List all the files that have changed: ${{ steps.changed-files-specific.outputs.all_changed_files }}"
./scripts/update-checksmd > checks.md
- name: Commit back the checks.md to the repository
if: steps.changed-files-specific.outputs.any_changed == 'true'
uses: stefanzweifel/git-auto-commit-action@v4
with:
# Optional. Commit message for the created commit.
# Defaults to "Apply automatic changes"
commit_message: "[skip ci] Autoupdate Checks.md on change"
# Optional. Local and remote branch name where commit is going to be pushed
# to. Defaults to the current branch.
# You might need to set `create_branch: true` if the branch does not exist.
branch: main
# Optional. Options used by `git-commit`.
# See https://git-scm.com/docs/git-commit#_options
commit_options: '--no-verify --signoff'
# Optional glob pattern of files which should be added to the commit
# Defaults to all (.)
# See the `pathspec`-documentation for git
# - https://git-scm.com/docs/git-add#Documentation/git-add.txt-ltpathspecgt82308203
# - https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddefpathspecapathspec
file_pattern: 'checks.md'
# Optional. Local file path to the repository.
# Defaults to the root of the repository.
repository: .