Skip to content

Commit

Permalink
#1 start
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Mar 17, 2024
0 parents commit 8b80a98
Show file tree
Hide file tree
Showing 13 changed files with 268 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/markdown-lint.yml
@@ -0,0 +1,10 @@
---
name: markdown-lint
on:
push:
jobs:
markdown-lint:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@8410ad0602e1e429cee44a835ae9f77f654a6694
- uses: articulate/actions-markdownlint@v1
15 changes: 15 additions & 0 deletions .github/workflows/shellcheck.yml
@@ -0,0 +1,15 @@
---
name: shellcheck
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
shellcheck:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: ludeeus/action-shellcheck@master
15 changes: 15 additions & 0 deletions .github/workflows/test.yml
@@ -0,0 +1,15 @@
name: test
on:
push:
pull_request:
jobs:
test:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: ./
with:
cmd: latexmk
path: .
opts: -pdf test
packages: ffcode fvextra catchfile xstring framed environ upquote
25 changes: 25 additions & 0 deletions .github/workflows/up.yml
@@ -0,0 +1,25 @@
---
name: up
on:
push:
branches:
- master
tags:
- '*'
jobs:
up:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- run: |-
git fetch --tags --force && \
latest=$(git tag --sort=creatordate | tail -1) && \
sed -E -i "s/bibcop-action@.+$/bibcop-action@${latest}/g" README.md
- uses: peter-evans/create-pull-request@v6
with:
branch: version-up
commit-message: 'new version in README'
delete-branch: true
title: 'New version in README'
assignees: yegor256
base: master
6 changes: 6 additions & 0 deletions .gitignore
@@ -0,0 +1,6 @@
test.pdf
test.aux
test.dvi
test.fdb_latexmk
test.fls
test.log
11 changes: 11 additions & 0 deletions .rultor.yml
@@ -0,0 +1,11 @@
docker:
image: yegor256/rultor-image:1.23.0
merge:
script: |-
sudo docker build "$(pwd)"
release:
pre: false
script: |-
[[ "${tag}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] || exit -1
sed -i -e "s/^0.0.0/${tag}/" Dockerfile
sudo docker build "$(pwd)"
33 changes: 33 additions & 0 deletions Dockerfile
@@ -0,0 +1,33 @@
# MIT License
#
# Copyright (c) 2024 Yegor Bugayenko
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

FROM yegor256/rultor-image:1.23.1

LABEL "repository"="https://github.com/yegor256/bibcop-action"
LABEL "maintainer"="Yegor Bugayenko"

RUN wget https://yegor256.github.io/bibcop/bibcop.pl /home/bibcop.pl

WORKDIR /home
COPY entry.sh /home

ENTRYPOINT ["/home/entry.sh"]
21 changes: 21 additions & 0 deletions LICENSE.txt
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021-2024 Yegor Bugayenko

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
27 changes: 27 additions & 0 deletions Makefile
@@ -0,0 +1,27 @@
# MIT License
#
# Copyright (c) 2024 Yegor Bugayenko
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

test:
docker run --rm -v "$$(pwd):/w" $$(docker build -q .)

clean:
rm -f *.dvi *.pdf *.fls *.aux *.fdb_latexmk *.log
31 changes: 31 additions & 0 deletions README.md
@@ -0,0 +1,31 @@
# Bibcop Github Action

[![test](https://github.com/yegor256/bibcop-action/actions/workflows/test.yml/badge.svg)](https://github.com/yegor256/bibcop-action/actions/workflows/test.yml)
[![License](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/yegor256/bibcop-action/blob/master/LICENSE.txt)

Checks the quality of all `.bib` files in the repository,
using [bibcop](https://github.com/yegor256/bibcop).

```yaml
name: bibcop
on:
push:
jobs:
bibcop:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@master
- uses: yegor256/bibcop-action@0.0.0
```

## How to Contribute

In order to test this action, just run:

```bash
make test
```

This should build a new Docker image and then try to use it
in order to render a simple `test.tex` document. You need to have
[Docker](https://docs.docker.com/get-docker/) installed.
35 changes: 35 additions & 0 deletions action.yml
@@ -0,0 +1,35 @@
# MIT License
#
# Copyright (c) 2021-2024 Yegor Bugayenko
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
---
name: 'bibcop-action'
description: 'Check the quality of .bib files'
branding:
icon: alert-triangle
color: orange
runs:
using: 'docker'
image: Dockerfile
inputs:
opts:
description: 'Command-line options for bibcop'
required: false
default: ''
33 changes: 33 additions & 0 deletions entry.sh
@@ -0,0 +1,33 @@
#!/bin/bash
# MIT License
#
# Copyright (c) 2024 Yegor Bugayenko
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

set -x
set -e
set -o pipefail

cd "${GITHUB_WORKSPACE-/w}"

read -r -a opts <<< "${INPUT_OPTS}"

chmod a+x /home/bibcop.pl
find . -name '.bib' -exec /home/bibcop.pl "${opts[@]}" {} \;
6 changes: 6 additions & 0 deletions renovate.json
@@ -0,0 +1,6 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:base"
]
}

0 comments on commit 8b80a98

Please sign in to comment.