generated from USP-Open-Code/discipline-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit ad22571
Showing
9 changed files
with
130 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,17 @@ | ||
## Descrição | ||
|
||
Descreva sua alteração no repositório (opcional) | ||
|
||
## Tipo de Mudança | ||
|
||
Selecione as opções aplicáveis | ||
|
||
- [ ] Novo Diretório (Adicionando nova atividade) | ||
- [ ] Minha atividade (Compartilhando meu código) | ||
- [ ] Alterações no Repositório | ||
|
||
## Checklist: | ||
|
||
- [ ] Meu código está funcional | ||
- [ ] Aceito que outras pessoas consumam meu código | ||
- [ ] Não é plágio e, caso aplicável, citei as referências |
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,40 @@ | ||
# Ensuring that every time a new directory is added to the repository, | ||
# the README.md file in the root is updated with a reference to its content. | ||
|
||
name: Validate README.md Update | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
check-readme: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out the repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Git | ||
run: git fetch --all | ||
|
||
- name: Identify new directories | ||
id: new_dirs | ||
run: | | ||
new_dirs=$(git diff --name-status origin/main | awk '$1 == "A" && $2 ~ /\/$/ {print $2}') | ||
echo "New directories added: $new_dirs" | ||
echo "::set-output name=new_dirs::$new_dirs" | ||
- name: Check if README.md was modified | ||
if: steps.new_dirs.outputs.new_dirs != '' | ||
run: | | ||
readme_changed=$(git diff --name-only origin/main | grep -c "README.md" || true) | ||
if [ $readme_changed -eq 0 ]; then | ||
echo "README.md was not updated. Please update it to reflect new directories." | ||
exit 1 | ||
else | ||
echo "README.md was updated." | ||
fi |
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 @@ | ||
name: Validate Repository Structure | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
validate-structure: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Validate Repository Structure | ||
run: | | ||
# Ensure the main README.md exists | ||
if [ ! -f "README.md" ]; then | ||
echo "Root README.md is missing. Please add a README.md with discipline name and code." | ||
exit 1 | ||
fi | ||
# Ensure each task folder has a README.md and no unauthorized files | ||
for dir in */ ; do | ||
if [ ! -f "${dir}/README.md" ]; then | ||
echo "Task ${dir} is missing a README.md. Each task folder must have a README.md file with the task description." | ||
exit 1 | ||
fi | ||
# Check that every file in the task folder follows the author naming convention | ||
for file in "${dir}"*; do | ||
filename=$(basename "$file") | ||
if [[ "$filename" != *"."* ]]; then | ||
echo "File ${filename} in ${dir} does not follow the naming convention. It should be named as 'author.extension'." | ||
exit 1 | ||
fi | ||
done | ||
done | ||
echo "Repository structure is valid." |
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,8 @@ | ||
# [Discipline Code] | ||
[Discipline name] | ||
|
||
# Pastas por tópicos: | ||
|
||
## Tópico 1 | ||
- [Task 1](./task1) | ||
- [Task 2](./task2) |
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,16 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v2.2.1 | ||
hooks: | ||
- id: no-commit-to-branch | ||
args: ['--pattern', '^(?!((new_dir|new_ex|bugfix)\/[a-zA-Z0-9\-]+)$).*'] | ||
|
||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v2.3.0 | ||
hooks: | ||
- id: end-of-file-fixer | ||
- id: trailing-whitespace | ||
- id: check-yaml | ||
- id: check-json | ||
- id: check-merge-conflict | ||
- id: check-toml |
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 @@ | ||
# Descrição da tarefa | ||
|
||
Adicione o enunciado ou descrição desta tarefa | ||
|
||
Sua solução deve respeitar o formato `seu_nome.extensao`. |
Empty file.
Empty file.
Empty file.