Skip to content

Commit c17b980

Browse files
author
Ahmad Nassri
committed
chore(template): sync with ahmadnassri/template-action-composite
1 parent 87b29df commit c17b980

File tree

6 files changed

+120
-19
lines changed

6 files changed

+120
-19
lines changed

.github/FUNDING.yml

+4
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1+
# ------------------------------------------------------------- #
2+
# Note: this file is automatically managed in template-template #
3+
# ------------------------------------------------------------- #
4+
15
github: [ahmadnassri]

.github/workflows/pull_request_target.yml

+61-4
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,74 @@ on: pull_request_target
66

77
name: pull_request_target
88

9+
permissions:
10+
pull-requests: write
11+
contents: write
12+
913
jobs:
14+
metadata:
15+
runs-on: ubuntu-latest
16+
17+
outputs:
18+
repository: ${{ steps.metadata.outputs.repository }}
19+
20+
steps:
21+
- uses: actions/[email protected]
22+
23+
- uses: ahmadnassri/action-metadata@v1
24+
id: metadata
25+
1026
auto-merge:
1127
timeout-minutes: 5
1228

1329
runs-on: ubuntu-latest
1430

15-
# security check: only run with dependabot PRs
16-
if: github.actor == 'dependabot[bot]'
31+
# only run for dependabot PRs
32+
if: ${{ github.actor == 'dependabot[bot]' }}
33+
34+
env:
35+
PR_URL: ${{github.event.pull_request.html_url}}
36+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
1737

1838
steps:
19-
- uses: actions/[email protected]
20-
- uses: ahmadnassri/[email protected]
39+
- id: dependabot
40+
uses: dependabot/[email protected]
41+
with:
42+
github-token: ${{ secrets.GITHUB_TOKEN }}
43+
44+
- name: auto merge conditions
45+
id: auto-merge
46+
if: |
47+
(
48+
steps.dependabot.outputs.update-type == 'version-update:semver-patch' &&
49+
contains('direct:production,indirect:production', steps.dependabot.outputs.dependency-type)
50+
) || (
51+
steps.dependabot.outputs.update-type == 'version-update:semver-minor' &&
52+
contains('direct:development,indirect:development', steps.dependabot.outputs.dependency-type)
53+
)
54+
run: echo "::notice ::auto-merge conditions satisfied"
55+
56+
- name: auto approve pr
57+
if: ${{ steps.auto-merge.conclusion == 'success' }}
58+
run: |
59+
gh pr review --approve "$PR_URL"
60+
gh pr merge --auto --rebase "$PR_URL"
61+
62+
template-sync:
63+
needs: metadata
64+
65+
timeout-minutes: 20
66+
67+
runs-on: ubuntu-latest
68+
69+
# only run for templates
70+
if: ${{ fromJSON(needs.metadata.outputs.repository).is_template }}
71+
72+
steps:
73+
- uses: actions/[email protected]
74+
with:
75+
ref: ${{ github.event.pull_request.head.ref }}
76+
- uses: ahmadnassri/[email protected]
77+
- uses: ahmadnassri/[email protected]
2178
with:
2279
github-token: ${{ secrets.GH_TOKEN }}

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.log

.pandoc.yml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# ----------------------------------------------- #
2+
# Note: this file originates in template-template #
3+
# ----------------------------------------------- #
4+
5+
input-file: docs/README.md
6+
output-file: README.md
7+
metadata-file: colophon.yml
8+
template: docs/README.template
9+
10+
from: gfm
11+
to: gfm
12+
13+
wrap: preserve
14+
reference-links: true
15+
fail-if-warnings: false

Makefile

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/usr/bin/make
2+
3+
# ------------------------------------------------------- #
4+
# Note: this file originates in template-action-composite #
5+
# ------------------------------------------------------- #
6+
7+
# Docker
8+
9+
pull: ## pull latest containers
10+
@docker compose pull
11+
12+
lint: ## run super-linter
13+
@docker compose run --rm lint
14+
15+
readme: ## run readme action
16+
@docker compose run --rm readme
17+
18+
clean: ## remove running containers, volumes, node_modules & anything else
19+
@docker compose rm --stop --volumes --force
20+
21+
# Utility methods
22+
## Help: https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html
23+
24+
help: ## display this help
25+
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
26+
27+
.DEFAULT_GOAL := help
28+
.PHONY: help

docker-compose.yml

+11-15
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,24 @@
1-
version: '3.8'
1+
# ------------------------------------------------------- #
2+
# Note: this file originates in template-action-composite #
3+
# ------------------------------------------------------- #
24

35
services:
46
# ---- super-linter ---- #
57
lint:
6-
image: github/super-linter:v3
8+
image: github/super-linter:slim-v4
79
volumes:
8-
- ./:/tmp/lint
10+
- ./:/workspace
911
environment:
10-
RUN_LOCAL: 'true'
1112
LOG_LEVEL: 'ERROR'
13+
RUN_LOCAL: 'true'
1214
MULTI_STATUS: 'false'
15+
IGNORE_GITIGNORED_FILES: 'true'
16+
DEFAULT_WORKSPACE: /workspace
17+
FILTER_REGEX_EXCLUDE: '/workspace/README.md'
1318

1419
# ---- readme generator ---- #
1520
readme:
16-
image: pandoc/core:2.11.4
21+
image: pandoc/minimal:2.18.0
1722
volumes:
1823
- ./:/data
19-
command: >-
20-
--metadata-file=colophon.yml
21-
--template=docs/README.template
22-
--output=README.md
23-
--from=gfm
24-
--to=gfm
25-
--fail-if-warnings
26-
--wrap=preserve
27-
--reference-links
28-
docs/README.md
24+
command: --defaults=.pandoc.yml

0 commit comments

Comments
 (0)