Skip to content

Commit b7bfb66

Browse files
committed
chore(copier): update from template
1 parent 4be92bb commit b7bfb66

13 files changed

Lines changed: 234 additions & 245 deletions
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# This file is @generated by <https://github.com/liblaf/copier-release>.
22
# DO NOT EDIT!
33
# prettier-ignore
4-
_commit: v0.1.4
4+
_commit: v0.2.0
55
_src_path: gh:liblaf/copier-release
6-
release_type: simple

.config/copier/.copier-answers.shared.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This file is @generated by <https://github.com/liblaf/copier-shared>.
22
# DO NOT EDIT!
33
# prettier-ignore
4-
_commit: v0.1.6
4+
_commit: v0.2.0
55
_src_path: gh:liblaf/copier-share
66
author_email: 30631553+liblaf@users.noreply.github.com
77
author_name: liblaf

.config/mise/conf.d/10-shared.toml

Lines changed: 0 additions & 6 deletions
This file was deleted.

.config/release-please/.manifest.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

.config/release-please/config.json

Lines changed: 0 additions & 59 deletions
This file was deleted.

.envrc

Lines changed: 0 additions & 13 deletions
This file was deleted.

.github/renovate.json

Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# This file is @generated by <https://github.com/liblaf/copier-shared>.
2+
# DO NOT EDIT!
3+
4+
name: Copier update
5+
6+
on:
7+
schedule:
8+
- cron: "0 0 * * 0" # Runs at 00:00, only on Sunday
9+
workflow_dispatch:
10+
11+
env:
12+
FORCE_COLOR: 1
13+
14+
jobs:
15+
copier-update:
16+
name: Copier update
17+
permissions:
18+
contents: write
19+
issues: write
20+
pull-requests: write
21+
runs-on: ubuntu-latest
22+
environment:
23+
name: Copier
24+
deployment: false
25+
steps:
26+
- id: auth
27+
name: Auth
28+
uses: liblaf/actions/auth@v1
29+
with:
30+
app-id: ${{ vars.APP_ID }}
31+
private-key: ${{ secrets.PRIVATE_KEY }}
32+
- name: Checkout
33+
uses: actions/checkout@v6
34+
- name: Copier update
35+
# `copier update` requires a clean working directory. We commit changes
36+
# after each update, then use `git reset --soft` to squash all commits
37+
# before creating a PR.
38+
run: |-
39+
copier=(pipx run --pip-args cookiecutter copier)
40+
if [[ -d '.config/copier/' ]]; then
41+
find '.config/copier/' -iname '.copier-answers*' -type f -print0 |
42+
while IFS= read -r -d '' answers_file; do
43+
echo "::group::$answers_file"
44+
"${copier[@]}" update --skip-answered --trust --answers-file "$answers_file" --defaults --quiet
45+
git add --all
46+
if ! git diff --cached --quiet; then
47+
git commit --message="chore(copier): update '$answers_file'"
48+
fi
49+
echo '::endgroup::'
50+
done
51+
fi
52+
- name: Git reset
53+
run: git reset --soft '${{ github.sha }}'
54+
- name: Create PR
55+
uses: peter-evans/create-pull-request@v8
56+
with:
57+
token: ${{ steps.auth.outputs.token }}
58+
commit-message: "chore(copier): update from template"
59+
branch: copier-update/${{ github.ref_name }}
60+
sign-commits: true
61+
title: "chore(copier): update from template"
62+
body: Automated changes by [${{ github.workflow }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) Workflow
63+
labels: |-
64+
automerge
65+
copier
66+
assignees: ${{ github.repository_owner }}
67+
reviewers: ${{ github.repository_owner }}

.github/workflows/mega-linter.yaml

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,24 @@ on:
1111
branches:
1212
- main
1313
pull_request:
14-
workflow_dispatch:
14+
branches:
15+
- main
1516

1617
env:
1718
FORCE_COLOR: 1
19+
GIT_COMMIT_MESSAGE: "chore(mega-linter): apply linters automatic fixes"
1820

1921
jobs:
2022
mega-linter:
2123
name: MegaLinter
2224
permissions:
2325
contents: write
26+
issues: write
2427
pull-requests: write
2528
runs-on: ubuntu-latest
2629
environment:
2730
name: MegaLinter
31+
deployment: false
2832
steps:
2933
- id: auth
3034
name: Auth
@@ -34,8 +38,6 @@ jobs:
3438
private-key: ${{ secrets.PRIVATE_KEY }}
3539
- name: Checkout
3640
uses: actions/checkout@v6
37-
with:
38-
ref: ${{ github.head_ref || github.ref }}
3941
- id: lint
4042
name: MegaLinter
4143
uses: liblaf/actions/mega-linter@v1
@@ -56,20 +58,24 @@ jobs:
5658
cp --target-directory='${{ runner.temp }}' --verbose 'megalinter-reports/megalinter-report.md'
5759
sudo rm --force --recursive 'mega-linter.log' 'megalinter-reports'
5860
- if: steps.lint.outputs.has-updated-sources > 0 && github.ref == 'refs/heads/main'
59-
name: Create PR with Applied Fixes
61+
name: Create PR
6062
uses: peter-evans/create-pull-request@v8
6163
with:
62-
commit-message: "chore(mega-linter): apply linters automatic fixes"
63-
branch: mega-linter-fix/${{ github.ref_name }}
64+
token: ${{ steps.auth.outputs.token }}
65+
commit-message: ${{ env.GIT_COMMIT_MESSAGE }}
66+
branch: mega-linter/${{ github.ref_name }}
6467
sign-commits: true
65-
title: "chore(mega-linter): apply linters automatic fixes"
68+
title: ${{ env.GIT_COMMIT_MESSAGE }}
6669
body-path: ${{ runner.temp }}/megalinter-report.md
67-
labels: automerge,bot
70+
labels: |-
71+
automerge
72+
mega-linter
6873
assignees: ${{ github.repository_owner }}
6974
reviewers: ${{ github.repository_owner }}
7075
- if: steps.lint.outputs.has-updated-sources > 0 && github.ref != 'refs/heads/main'
71-
name: Commit and Push Applied Linter Fixes
72-
uses: liblaf/actions/commit@v1
76+
name: Commit
77+
uses: suzuki-shunsuke/commit-action@v0.1.1
7378
with:
74-
add-options: --verbose --update
75-
message: "chore(mega-linter): apply linters automatic fixes"
79+
github_token: ${{ steps.auth.outputs.token }}
80+
commit_message: ${{ env.GIT_COMMIT_MESSAGE }}
81+
fail_on_self_push: false
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# This file is @generated by <https://github.com/liblaf/copier-release>.
2+
# DO NOT EDIT!
3+
4+
name: Release > create
5+
6+
on:
7+
pull_request:
8+
branches:
9+
- main
10+
types:
11+
- closed
12+
13+
jobs:
14+
release-create:
15+
name: Create release
16+
if: >-
17+
github.head_ref == 'release-please' &&
18+
github.event.pull_request.merged
19+
runs-on: ubuntu-latest
20+
environment:
21+
name: Release Please
22+
deployment: false
23+
steps:
24+
- id: auth
25+
name: Auth
26+
uses: liblaf/actions/auth@v1
27+
with:
28+
app-id: ${{ vars.APP_ID }}
29+
private-key: ${{ secrets.PRIVATE_KEY }}
30+
- name: Checkout
31+
uses: actions/checkout@v6
32+
with:
33+
token: ${{ steps.auth.outputs.token }}
34+
- id: version
35+
name: Get version
36+
run: |-
37+
tag="$(awk '{ print $NF }' <<< "$TITLE")"
38+
version="${tag#'v'}"
39+
echo "tag=$tag" >> "$GITHUB_OUTPUT"
40+
echo "version=$version" >> "$GITHUB_OUTPUT"
41+
env:
42+
TITLE: ${{ github.event.pull_request.title }}
43+
- name: Create tag
44+
run: |-
45+
git tag --annotate --message='${{ steps.version.outputs.tag }}' '${{ steps.version.outputs.tag }}'
46+
git push origin 'refs/tags/${{ steps.version.outputs.tag }}'
47+
- id: immutable-releases
48+
name: Check if immutable releases are enabled
49+
run: |-
50+
enabled="$(gh api '/repos/${{ github.repository }}/immutable-releases' --jq '.enabled')"
51+
echo "enabled=$enabled" >> "$GITHUB_OUTPUT"
52+
env:
53+
GH_TOKEN: ${{ steps.auth.outputs.token }}
54+
continue-on-error: true
55+
- name: Create release
56+
uses: softprops/action-gh-release@v2
57+
with:
58+
body: ${{ github.event.pull_request.body }}
59+
tag_name: ${{ steps.version.outputs.tag }}
60+
draft: ${{ steps.immutable-releases.outputs.enabled == 'true' }}
61+
token: ${{ steps.auth.outputs.token }}

0 commit comments

Comments
 (0)