Skip to content

Commit

Permalink
Merge EbookFoundation#7034 into maintenance/homogenize-in-process-notes
Browse files Browse the repository at this point in the history
Cherry picked until commit 9bfd191 + f7fea66
  • Loading branch information
davorpa committed Sep 2, 2022
2 parents 4f31e96 + 9bfd191 commit cf03bd0
Show file tree
Hide file tree
Showing 40 changed files with 548 additions and 374 deletions.
94 changes: 94 additions & 0 deletions .github/actions/awesomebot-gh-summary-action/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: 'AwesomeBot Markdown Summary Report'
description: 'Composes the summary report using JSON results of any AwesomeBot execution'

inputs:
ab-root:
description: 'Path where AwesomeBot result files are written.'
required: true
files:
description: 'A delimited string containing the filenames to process.'
required: true
separator:
description: 'Token used to delimit each filename. Default: " ".'
required: false
default: ' '
append-heading:
description: 'When should append report heading.'
required: false
default: "false"
write:
description: 'When should append the report to GITHUB_STEP_SUMMARY file descriptor.'
required: false
default: "true"

outputs:
text:
description: Generated Markdown text.
value: ${{ steps.generate.outputs.text }}

runs:
using: "composite"

steps:

- name: Generate markdown
id: generate
# Using PowerShell
shell: pwsh
# sec: sanatize inputs using environment variables
env:
GITHUB_ACTION_PATH: ${{ github.action_path }}
GITHUB_WORKSPACE: ${{ github.workspace }}
# INPUT_<VARIABLE_NAME> is not available in Composite run steps
# https://github.521000.bestmunity/t/input-variable-name-is-not-available-in-composite-run-steps/127611
INPUT_AB_ROOT: ${{ inputs.ab-root }}
INPUT_FILES: ${{ inputs.files }}
INPUT_SEPARATOR: ${{ inputs.separator }}
INPUT_APPEND_HEADING: ${{ inputs.append-heading }}
run: |
$text = ""
# Handle optional heading
if ("true" -eq $env:INPUT_APPEND_HEADING) {
$text += "### Report of Checked URLs!"
$text += "`n`n"
$text += "<div align=`"right`" markdown=`"1`">`n`n"
$text += "_Link issues :rocket: powered by [``awesome_bot``](https://github.com/dkhamsing/awesome_bot)_."
$text += "`n`n</div>"
}
# Loop ForEach files
$env:INPUT_FILES -split $env:INPUT_SEPARATOR | ForEach {
$file = $_
$abr_file = $env:INPUT_AB_ROOT + "/ab-results-" + ($file -replace "[/\\]","-") + "-markdown-table.json"
$json = Get-Content $abr_file | ConvertFrom-Json
$text += "`n`n"
if ("true" -eq $json.error) {
# Highlighting issues counter
$SearchExp = '(?<Num>\d+)'
$ReplaceExp = '**${Num}**'
$text += "`:page_facing_up: File: ``" + $file + "`` (:warning: " + ($json.title -replace $SearchExp,$ReplaceExp) + ")"
# removing where ab attribution lives (moved to report heading)
$text += $json.message -replace "####.*?\n","`n"
} else {
$text += ":page_facing_up: File: ``" + $file + "`` (:ok: **No issues**)"
}
}
# HACK to single line strings (https://trstringer.com/github-actions-multiline-strings/)
$text = $text -replace "`%","%25"
$text = $text -replace "`n","%0A"
$text = $text -replace "`r","%25"
# set output
echo "::set-output name=text::$text"
- name: Write output
if: ${{ fromJson(inputs.write) }}
shell: bash
env:
INPUT_TEXT: ${{ steps.generate.outputs.text }}
INPUT_WRITE: ${{ inputs.write }}
run: |
echo "$INPUT_TEXT" >> $GITHUB_STEP_SUMMARY
78 changes: 70 additions & 8 deletions .github/workflows/check-urls.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,81 @@
name: Check URLs from changed files
on: [push, pull_request]

on:
push:
pull_request:

permissions:
contents: read

# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref || github.run_id }}'
cancel-in-progress: true

jobs:
job:
check-urls:
runs-on: ubuntu-latest

outputs:
changed-files: ${{ steps.changed-files.outputs.all_changed_files }}

steps:

# NOTE: tj-actions/changed-files.
# For push events you need to include fetch-depth: 0 | 2 depending on your use case.
# 0: retrieve all history for all branches and tags
# 1: retrieve current commit (by default)
# 2: retrieve the preceding commit
- name: Determine workflow parameters
id: init-params
run: |
echo "::set-output name=fetch_depth::0";
if [ "${{ github.event_name }}" == "pull_request" ]; then
echo "::set-output name=fetch_depth::1";
fi
- uses: actions/checkout@v3
- uses: trilom/[email protected]
id: file_changes
with:
output: ''
fetch-depth: ${{ steps.init-params.outputs.fetch_depth }}

- name: Get changed files
id: changed-files
uses: tj-actions/[email protected]
with:
separator: " "

- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6
- run: gem install awesome_bot
- run: for i in ${{ steps.file_changes.outputs.files_modified }}; do echo; echo "processing $i"; awesome_bot $i --allow-redirect --allow-dupe --allow-ssl || true; done

- run: |
gem install awesome_bot
- name: Check each changed file
run: |
# Set field separator
IFS=$' ';
# Processing loop
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
echo;
echo "::group::Processing file... $file";
awesome_bot "$file" --allow-redirect --allow-dupe --allow-ssl || true;
echo "::endgroup::";
done
# Unset field separator
unset IFS;
- uses: actions/upload-artifact@v3
with:
path: ${{ github.workspace }}/*.json
name: awesomebot-results
path: ${{ github.workspace }}/ab-results-*.json

- name: Generate Summary Report using AwesomeBot results
uses: ./.github/actions/awesomebot-gh-summary-action
with:
ab-root: ${{ github.workspace }}
files: ${{ steps.changed-files.outputs.all_changed_files }}
separator: " "
append-heading: ${{ true }}
4 changes: 2 additions & 2 deletions books/free-programming-books-ar.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@

### DB & DBMS

* [تصميم قواعد البيانات](https://academy.hsoub.com/files/26-تصميم-قواعد-البيانات/) - Adrienne Watt & Nelson Eng، ترجمة أيمن طارق وعلا عباس (PDF)
* [تصميم قواعد البيانات](https://academy.hsoub.com/files/26-تصميم-قواعد-البيانات/) - Adrienne Watt, Nelson Eng، ترجمة أيمن طارق وعلا عباس (PDF)


### HTML and CSS
Expand Down Expand Up @@ -77,7 +77,7 @@
* [أوبنتو ببساطة](https://www.simplyubuntu.com) - Ahmed AbouZaid&rlm; (PDF)
* [دفتر مدير دبيان](https://ar.debian-handbook.info) - Raphaël Hertzog, Roland Mas, MUHAMMET SAİT Muhammet Sait&rlm; (PDF, HTML)
* [دليل إدارة خواديم أوبنتو 14.04](https://academy.hsoub.com/files/10-دليل-إدارة-خواديم-أوبنتو/) - Ubuntu documentation team, Abdullatif Eymash&rlm; (PDF)
* [سطر أوامر لينكس](https://itwadi.com/node/2765) - Willam E. Shotts, Jr، ترجمة عبد اللطيف ايمش (PDF)
* [سطر أوامر لينكس](https://itwadi.com/node/2765) - Willam E. Shotts Jr., ترجمة عبد اللطيف ايمش (PDF)


### Open Source Software
Expand Down
2 changes: 1 addition & 1 deletion books/free-programming-books-cs.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* [Sítě](#site)
* [LaTeX](#latex)
* [Linux](#linux)
* [Distribuce](#distribuce)
* [Distribuce](#distribuce)
* [OpenSource](#opensource)
* [PHP](#php)
* [Python](#python)
Expand Down
7 changes: 3 additions & 4 deletions books/free-programming-books-de.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@
### Assembly Language

* [PC Assembly Language](http://drpaulcarter.com/pcasm) - Paul A. Carter
* [Reverse Engineering für Einsteiger](https://beginners.re/RE4B-DE.pdf) - Dennis Yurichev, Dennis Siekmeier, Julius Angres,
Dirk Loser, Clemens Tamme, Philipp Schweinzer (PDF)
* [Reverse Engineering für Einsteiger](https://beginners.re/RE4B-DE.pdf) - Dennis Yurichev, Dennis Siekmeier, Julius Angres, Dirk Loser, Clemens Tamme, Philipp Schweinzer (PDF)


### C
Expand Down Expand Up @@ -98,7 +97,7 @@ Dirk Loser, Clemens Tamme, Philipp Schweinzer (PDF)
* [Effektiv Go Programmieren](http://www.bitloeffel.de/DOC/golang/effective_go_de.html) (Online)
* [Eine Tour durch Go](https://github.com/michivo/go-tour-de)
* [Erstelle Webanwendungen mit Go](https://astaxie.gitbooks.io/build-web-application-with-golang/content/de)
* [The Little Go Book](https://github.com/Aaronmacaron/the-little-go-book-de) - Karl Seguin, Aaron Ebnöther ([HTML](https://github.com/Aaronmacaron/the-little-go-book-de/blob/master/de/go.md))
* [The Little Go Book](https://github.com/Aaronmacaron/the-little-go-book-de) - Karl Seguin, `trl.:` Aaron Ebnöther ([HTML](https://github.com/Aaronmacaron/the-little-go-book-de/blob/master/de/go.md))


### Groovy
Expand Down Expand Up @@ -154,7 +153,7 @@ Dirk Loser, Clemens Tamme, Philipp Schweinzer (PDF)

### Mathematik

* [Calcul mathématique avec SAGE](http://www.loria.fr/~zimmerma/sagebook/CalculDeutsch.pdf) - Paul Zimmermann et al. (PDF)
* [Calcul mathématique avec SAGE](http://www.loria.fr/~zimmerma/sagebook/CalculDeutsch.pdf) - Paul Zimmermann, et al. (PDF)


### Meta-Lists
Expand Down
16 changes: 8 additions & 8 deletions books/free-programming-books-es.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
* [Apuntes de Base de Datos 1](http://rua.ua.es/dspace/bitstream/10045/2990/1/ApuntesBD1.pdf) (PDF)
* [Base de Datos (2005)](http://www.uoc.edu/masters/oficiales/img/913.pdf) - Mercedes Marqués (PDF)
* [Base de Datos (2011)](https://openlibra.com/es/book/download/bases-de-datos-2) - Mercedes Marqués (PDF)
* [Base de Datos Avanzadas (2013)](https://openlibra.com/es/book/download/bases-de-datos-avanzadas) - Aramburu & Sanz Blasco (PDF)
* [Base de Datos Avanzadas (2013)](https://openlibra.com/es/book/download/bases-de-datos-avanzadas) - María José Aramburu Cabo, Ismael Sanz Blasco (PDF)
* [Diseño Conceptual de Bases de Datos](https://openlibra.com/es/book/download/diseno-conceptual-de-bases-de-datos) (PDF)


Expand Down Expand Up @@ -117,7 +117,7 @@

#### Sistemas Operativos

* [Fundamentos de Sistemas Operativos](http://sistop.org/pdf/sistemas_operativos.pdf) - Gunnar Wolf et al (PDF)
* [Fundamentos de Sistemas Operativos](http://sistop.org/pdf/sistemas_operativos.pdf) - Gunnar Wolf, et al. (PDF)
* [Sistemas Operativos](http://sistop.gwolf.org/html/biblio/Sistemas_Operativos_-_Luis_La_Red_Martinez.pdf) - Dr. David Luis la Red (PDF)


Expand All @@ -142,7 +142,7 @@

### Ensamblador

* [Lenguaje Ensamblador para PC](https://pacman128.github.io/static/pcasm-book-spanish.pdf) - Paul A.Carter (PDF)
* [Lenguaje Ensamblador para PC](https://pacman128.github.io/static/pcasm-book-spanish.pdf) - Paul A. Carter, `trl.:` Leonardo Rodríguez Mújica (PDF)


### Erlang
Expand All @@ -166,7 +166,7 @@

### Go

* [El pequeño libro Go](https://raulexposito.com/the-little-go-book-en-castellano.html) - Karl Seguin, Raúl Expósito (HTML, [PDF](https://raulexposito.com/assets/pdf/go.pdf), [EPUB](https://raulexposito.com/assets/epub/go.epub))
* [El pequeño libro Go](https://raulexposito.com/the-little-go-book-en-castellano.html) - Karl Seguin, `trl.:` Raúl Expósito (HTML, [PDF](https://raulexposito.com/assets/pdf/go.pdf), [EPUB](https://raulexposito.com/assets/epub/go.epub))
* [Go en Español](https://nachopacheco.gitbooks.io/go-es/content/doc) - Nacho Pacheco (HTML)


Expand Down Expand Up @@ -223,7 +223,7 @@
* [¿Cómo aprender AngularJS?](http://raulexposito.com/documentos/como-aprender-angularjs/) (HTML)
* [AngularJS](https://eladrodriguez.gitbooks.io/angularjs) - Elad Rodriguez (HTML) (Gitbook)
* [Guía de estilo AngularJS](https://github.com/johnpapa/angular-styleguide/blob/master/a1/i18n/es-ES.md) - John Papa et al. (HTML)
* [Guía de estilo AngularJS](https://github.com/johnpapa/angular-styleguide/blob/master/a1/i18n/es-ES.md) - John Papa, et al., `trl.:` Alberto Calleja Ríos, Gilberto (HTML)
* [Manual de AngularJS](https://desarrolloweb.com/manuales/manual-angularjs.html) - desarrolloweb.com (HTML, PDF, EPUB, Kindle)


Expand Down Expand Up @@ -264,7 +264,7 @@

### Matemáticas

* [Sage para Estudiantes de Pregrado](http://www.sage-para-estudiantes.com) - Gregory Bard
* [Sage para Estudiantes de Pregrado](http://www.sage-para-estudiantes.com) - Gregory Bard, `trl.:` Diego Sejas Viscarra


### .NET (C# / Visual Studio)
Expand All @@ -283,7 +283,7 @@

#### Redis

* [El pequeño libro Redis](https://raulexposito.com/the-little-redis-book-en-castellano.html) - Karl Seguin (HTML, PDF, EPUB)
* [El pequeño libro Redis](https://raulexposito.com/the-little-redis-book-en-castellano.html) - Karl Seguin, `trl.:` Raúl Expósito (HTML, PDF, EPUB)


### PHP
Expand Down Expand Up @@ -392,7 +392,7 @@

* [Aprendizaje TypeScript](https://riptutorial.com/Download/typescript-es.pdf) - riptutorial (PDF)
* [Introduccion a TypeScript](https://khru.gitbooks.io/typescript/) - Emmanuel Valverde Ramos (HTML) (GitBook)
* [TypeScript Deep Dive](https://github.com/melissarofman/typescript-book) - Basarat Ali Syed, Melissa Rofman (HTML) (GitBook)
* [TypeScript Deep Dive](https://github.com/melissarofman/typescript-book) - Basarat Ali Syed, `trl.:` Melissa Rofman (HTML) (GitBook)
* [Uso avanzado de TypeScript en un ejemplo real](https://neliosoftware.com/es/blog/uso-avanzado-de-typescript/) - Nelio Software (HTML)


Expand Down
4 changes: 2 additions & 2 deletions books/free-programming-books-et.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* [Java](#java)
* [JavaScript](#javascript)
* [AngularJS](#angularjs)
* [Vue](#vue)
* [Vue.js](#vuejs)
* [PHP](#php)
* [Python](#python)
* [R](#r)
Expand Down Expand Up @@ -45,7 +45,7 @@
* [AngularJS raamistiku õppematerjal](https://www.cs.tlu.ee/teemad/get_file.php?id=400) - Sander Leetus (PDF)


#### Vue
#### Vue.js

* [Vue.js raamistiku õppematerjal](https://www.cs.tlu.ee/teemaderegister/get_file.php?id=715) - Fred Korts (PDF)

Expand Down
2 changes: 1 addition & 1 deletion books/free-programming-books-fa_IR.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

* [الگوهای طراحی](https://holosen.net/what-is-design-pattern/) - Hossein Badrnezhad *(نیاز به ثبت نام دارد)*
* [الگوهای طراحی در برنامه‌نویسی شیء‌گرا](https://github.com/khajavi/Practical-Design-Patterns)
* [ترجمه آزاد کتاب کد تمیز](https://codetamiz.vercel.app) - Robert C. Martin et al.
* [ترجمه آزاد کتاب کد تمیز](https://codetamiz.vercel.app) - Robert C. Martin, et al.


### HTML and CSS
Expand Down
Loading

0 comments on commit cf03bd0

Please sign in to comment.