-
Notifications
You must be signed in to change notification settings - Fork 244
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1431 from LizenzFass78851/auto-gen-md-file
Add Automatic Workflow to Update *.md's with updated links
- Loading branch information
Showing
9 changed files
with
424 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/bin/bash | ||
|
||
# Voreinstellungen | ||
SUCHVERZEICHNIS=Blocklisten | ||
PATCHTHEFILE=Blocklisten.md | ||
|
||
TEMPLATE_S1=./Template/$PATCHTHEFILE/01 | ||
TEMPLATE_S2=./Template/$PATCHTHEFILE/02 | ||
|
||
LINKS=/tmp/$SUCHVERZEICHNIS.txt | ||
|
||
# Hole die Links | ||
rm $LINKS | ||
|
||
find ./$SUCHVERZEICHNIS/* -name '*' -type f \ | ||
| grep -v ".md" \ | ||
| sed 's#^.#https://raw.githubusercontent.com/RPiList/specials/master#g' \ | ||
| grep -v "DomainSquatting/" \ | ||
| sort >> $LINKS | ||
|
||
find ./$SUCHVERZEICHNIS/* -name '*' -type f \ | ||
| grep -v ".md" \ | ||
| sed 's#^.#https://raw.githubusercontent.com/RPiList/specials/master#g' \ | ||
| grep "DomainSquatting/" \ | ||
| sort >> $LINKS | ||
|
||
# Lösche die Datei | ||
rm $PATCHTHEFILE | ||
|
||
# Erstelle die Datei | ||
# Schicht 1 | ||
while read line; do | ||
echo "$line " >> $PATCHTHEFILE | ||
done < $TEMPLATE_S1 | ||
|
||
# Die Links | ||
while read line; do | ||
echo "$line " >> $PATCHTHEFILE | ||
done < $LINKS | ||
|
||
# Schicht 2 | ||
while read line; do | ||
echo "$line " >> $PATCHTHEFILE | ||
done < $TEMPLATE_S2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/bin/bash | ||
|
||
# Voreinstellungen | ||
SUCHVERZEICHNIS=DNSMASQ | ||
PATCHTHEFILE=readme.md | ||
|
||
TEMPLATE_S1=./Template/$SUCHVERZEICHNIS/$PATCHTHEFILE/01 | ||
TEMPLATE_S2=./Template/$SUCHVERZEICHNIS/$PATCHTHEFILE/02 | ||
|
||
LINKS=/tmp/$SUCHVERZEICHNIS.txt | ||
|
||
# Hole die Links | ||
rm $LINKS | ||
|
||
find ./$SUCHVERZEICHNIS/* -name '*' -type f \ | ||
| grep -v ".md" \ | ||
| sed 's#^.#https://raw.githubusercontent.com/RPiList/specials/master#g' \ | ||
| grep -v "DomainSquatting/" \ | ||
| sort >> $LINKS | ||
|
||
find ./$SUCHVERZEICHNIS/* -name '*' -type f \ | ||
| grep -v ".md" \ | ||
| sed 's#^.#https://raw.githubusercontent.com/RPiList/specials/master#g' \ | ||
| grep "DomainSquatting/" \ | ||
| sort >> $LINKS | ||
|
||
# Lösche die Datei | ||
rm $SUCHVERZEICHNIS/$PATCHTHEFILE | ||
|
||
# Erstelle die Datei | ||
# Schicht 1 | ||
while read line; do | ||
echo "$line " >> $SUCHVERZEICHNIS/$PATCHTHEFILE | ||
done < $TEMPLATE_S1 | ||
|
||
# Die Links | ||
while read line; do | ||
echo "$line " >> $SUCHVERZEICHNIS/$PATCHTHEFILE | ||
done < $LINKS | ||
|
||
# Schicht 2 | ||
while read line; do | ||
echo "$line " >> $SUCHVERZEICHNIS/$PATCHTHEFILE | ||
done < $TEMPLATE_S2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
name: gen_blocklisten.md | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
paths: | ||
- '.github/workflows/gen_blocklisten.md.yml' | ||
- '.github/scripts/gen_blocklisten.md.sh' | ||
- 'Template/Blocklisten.md/*' | ||
schedule: | ||
- cron: '20 12 * * *' | ||
workflow_dispatch: | ||
|
||
env: | ||
SCRIPT: .github/scripts/gen_blocklisten.md.sh | ||
|
||
jobs: | ||
build: | ||
container: | ||
image: ubuntu:22.04 | ||
|
||
runs-on: ubuntu-latest | ||
if: github.repository == 'RPiList/specials' | ||
|
||
steps: | ||
|
||
- name: key | ||
id: key | ||
run: | | ||
export KEY="${GITHUB_WORKFLOW%-*}" | ||
echo "key=$KEY" >> $GITHUB_OUTPUT | ||
echo "################################################################" && bash -c "echo KEY=$KEY" | ||
- name: update | ||
run: apt-get -y update && apt-get -y upgrade && apt-get -y dist-upgrade | ||
|
||
- name: install | ||
run: | | ||
DEBIAN_FRONTEND=noninteractive apt-get -y install \ | ||
git locales | ||
- name: locale | ||
run: locale-gen en_US.utf8 && locale-gen de_DE.UTF-8 && update-locale | ||
|
||
- name: clone | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
git config --global --add safe.directory $GITHUB_WORKSPACE | ||
git clone https://github-actions:$GITHUB_TOKEN@${GITHUB_SERVER_URL##*/}/$GITHUB_REPOSITORY.git $GITHUB_WORKSPACE --branch $GITHUB_REF_NAME | ||
- name: generate | ||
run: | | ||
export LANG=en_US.utf8 | ||
[ "${{ github.workflow }}" != "${{ steps.key.outputs.key }}" ] && c=5 || c=1 | ||
seq $c | while read x; do chmod +x ${{ env.SCRIPT }} && ./${{ env.SCRIPT }}; done | ||
- name: commit | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
git config --global --add safe.directory $GITHUB_WORKSPACE | ||
git pull | ||
git add . | ||
git status | ||
git config --local user.name github-actions | ||
git config --local user.email [email protected] | ||
git diff --cached --quiet && exit 0 || git commit -m "Auto-Update" | ||
git config --local credential.helper '!x() { echo "password=$GITHUB_TOKEN"; };x' | ||
git push origin $GITHUB_REF_NAME | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
name: gen_dnsmasq_readme.md | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
paths: | ||
- '.github/workflows/gen_dnsmasq_readme.md.yml' | ||
- '.github/scripts/gen_dnsmasq_readme.md.sh' | ||
- 'Template/DNSMASQ/readme.md/*' | ||
schedule: | ||
- cron: '20 12 * * *' | ||
workflow_dispatch: | ||
|
||
env: | ||
SCRIPT: .github/scripts/gen_dnsmasq_readme.md.sh | ||
|
||
jobs: | ||
build: | ||
container: | ||
image: ubuntu:22.04 | ||
|
||
runs-on: ubuntu-latest | ||
if: github.repository == 'RPiList/specials' | ||
|
||
steps: | ||
|
||
- name: key | ||
id: key | ||
run: | | ||
export KEY="${GITHUB_WORKFLOW%-*}" | ||
echo "key=$KEY" >> $GITHUB_OUTPUT | ||
echo "################################################################" && bash -c "echo KEY=$KEY" | ||
- name: update | ||
run: apt-get -y update && apt-get -y upgrade && apt-get -y dist-upgrade | ||
|
||
- name: install | ||
run: | | ||
DEBIAN_FRONTEND=noninteractive apt-get -y install \ | ||
git locales | ||
- name: locale | ||
run: locale-gen en_US.utf8 && locale-gen de_DE.UTF-8 && update-locale | ||
|
||
- name: clone | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
git config --global --add safe.directory $GITHUB_WORKSPACE | ||
git clone https://github-actions:$GITHUB_TOKEN@${GITHUB_SERVER_URL##*/}/$GITHUB_REPOSITORY.git $GITHUB_WORKSPACE --branch $GITHUB_REF_NAME | ||
- name: generate | ||
run: | | ||
export LANG=en_US.utf8 | ||
[ "${{ github.workflow }}" != "${{ steps.key.outputs.key }}" ] && c=5 || c=1 | ||
seq $c | while read x; do chmod +x ${{ env.SCRIPT }} && ./${{ env.SCRIPT }}; done | ||
- name: commit | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
git config --global --add safe.directory $GITHUB_WORKSPACE | ||
git pull | ||
git add . | ||
git status | ||
git config --local user.name github-actions | ||
git config --local user.email [email protected] | ||
git diff --cached --quiet && exit 0 || git commit -m "Auto-Update" | ||
git config --local credential.helper '!x() { echo "password=$GITHUB_TOKEN"; };x' | ||
git push origin $GITHUB_REF_NAME | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Blocklisten zur Ergänzung nach eigenem Ermessen. Die Listen stammen teilweise von Dritten und können daher nicht auf Richtigkeit geprüft werden. Doppelnennungen möglich. | ||
|
||
# Eigene Listen (Copy & Paste): | ||
|
||
``` |
Oops, something went wrong.