-
Notifications
You must be signed in to change notification settings - Fork 4
90 lines (71 loc) · 3.09 KB
/
update-readme.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: Update-Readme
# Controls when the workflow will run
on:
push:
branches:
- master
workflow_dispatch:
jobs:
build_run_commit:
# The type of runner that the job will run on
runs-on: ubuntu-latest
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# added or changed files to the repository.
contents: write
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
with:
ref: master
fetch-depth: 0
token: ${{ secrets.PAT }} # It is necessary to `Commit changes` section can bypass branch protection rules.
- name: Run Docker Compose
run: |
cd readme-generator-configs
docker compose up --abort-on-container-exit
- name: Check for changes
id: check_changes
run: |
if [[ -z "$(git status --porcelain)" ]]; then
echo "No changes to commit."
echo "has_changes=false" >> $GITHUB_OUTPUT
else
echo "Changes found."
echo "has_changes=true" >> $GITHUB_OUTPUT
fi
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v5
if: steps.check_changes.outputs.has_changes == 'true'
with:
commit_message: 'docs(readme): update contents automatically'
# 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: master
# Optional. Options used by `git-commit`.
# See https://git-scm.com/docs/git-commit#_options
commit_options: '--no-verify --signoff --allow-empty'
# Optional. Local file path to the repository.
# Defaults to the root of the repository.
repository: .
# Optional. Option used by `git-status` to determine if the repository is
# dirty. See https://git-scm.com/docs/git-status#_options
status_options: '--untracked-files=no'
# Optional. Options used by `git-add`.
# See https://git-scm.com/docs/git-add#_options
add_options: '-u'
# Optional. Options used by `git-push`.
# See https://git-scm.com/docs/git-push#_options
push_options: '--force'
# Optional. Disable dirty check and always try to create a commit and push
skip_dirty_check: true
# Optional. Skip internal call to `git fetch`
skip_fetch: true
# Optional. Skip internal call to `git checkout`
skip_checkout: true
# Optional. Prevents the shell from expanding filenames.
# Details: https://www.gnu.org/software/bash/manual/html_node/Filename-Expansion.html
disable_globbing: true
# Optional. Create given branch name in local and remote repository.
create_branch: true