- VCS : version control system
- SCM : software configuration management
- Fork : copie du repo coté serveur
- Opérateurs:
OR, AND, NOT
- Repo:
repo:Aif4thah/Dojo-101 windows
- User:
user:Aif4thah
- Owner:
owner:Aif4thah
is:open is:issue assignee:@me
: Open issues assigned to the current user (@me)is:closed is:pr author:contoso
: Closed pull requests created by @contosois:pr sidebar in:comments
: Pull requests where "sidebar" is mentioned in the commentsis:open is:issue label:bug -linked:pr
: Open issues labeled as bugs that do not have a linked pull request
- Personal
- Organization
- Enterprise
- GitHub Free for personal accounts and organizations
- GitHub Pro for personal accounts
- GitHub Team
- GitHub Enterprise
- Copilot (IA)
- CodeSpace (VM & storage lié à une extension de l'éditeur)
- Projects (Boards (Kanban), Data, Insight (Indicateurs), Automation (API, Github Actions))
- InnerSource -> application des pratiques OpenSource sur des dépots privés d'entreprises
- PSSI dans
SECURITY.md
- Security advisories pour discuter ou corriger une vuln
.gitignore
pour ne pas commit de fichiers sensibles- Branch protection rules
- fichiers
CODEOWNERS
pour déterminer des responsable à la racine du repo ou.github
ou dossiersdocs
- Scan des dépendances (dependabot)
- Scan du code (CodeQL)
- Scan des secrets
-
Login / passwd
-
Token (PAT : personal access token)
-
SSH keys
-
Deploy key (SSH single repo)
-
2 Factors (TOTP)
-
SAML SSO (with SCIM System for Cross-domain Identity Management and a Identity Provider (IdP) )
-
LDAP
- Create a branch
- Add commits
- Open a pull request
- Code review
- Deploy
- Merge
- Read : Recommended for non-code contributors who want to view or discuss your project. This level is good for anyone that needs to view the content within the repository but doesn't need to actually make contributions or changes.
- Triage : Recommended for contributors who need to proactively manage issues and pull requests without write access. This level could be good for some project managers who manage tracking issues but don't make any changes.
- Write : Recommended for contributors who actively push to your project. Write is the standard permission for most developers.
- Maintain : Recommended for project managers who need to manage the repository without access to sensitive or destructive actions.
- Admin : Recommended for people who need full access to the project, including sensitive and destructive actions like managing security or deleting a repository. These people are repository owners and administrators.
git status
git add # start keeping track of changes in certain files
git commint # save your work to a snapshot
git log
git help
git config --global user.email <mail>
git config --global user.name <mail>
git add *
git commit -m "update MM-YYYY"
git push origin main
git branch
git blame
Cliquer sur le bouton fork
via l'interface Web, on obtient un fork sous la forme
https://github.com/<YourUserName>/demo
cloner ensuite votre fork pour travailler:
git clone https://github.com/<YourUserName>/demo
Une fois les changements commit
et push
, utiliser le bouton Compare & pull request button
sur Github
/!\ d'un point de vue sécu, les hooks peuvent permettre des actions malveillantes et doive être contrôlés
Stockés dans .git/hooks
, exécute du code avant ou après un événement cible
Shebang sous windows: #!C:/Program\ Files/Git/usr/bin/sh.ex
Un hooks n'est pas commit par défaut, il faut utiliser les paramètres globaux
Git config --global core.hooksPath '~/.githooks
Si pbm avec les hooks
Git commit --no-verify
git checkout --orphan latest_branch
git add -A
git commit -am "Init"
git branch -D main # suppression
git branch -m main # renommage de la branche en main
git push -f origin main #push vers la branche main
git gc --aggressive --prune=all # supression des anciens fichiers
This workflow will build a .NET project, more information here
name: .NET
on:
push:
branches: [ "main" ]
tags:
- '*'
pull_request:
branches: [ "main" ]
tags:
- '*'
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: Display dotnet version
run: dotnet --version
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Publish
run: dotnet publish -c Release -o ./publish
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: my-artifact
path: ./publish/
Ils peuvent être gérés depuis Settings
-> Security
-> Secrets and variables
.
Ils sont ensuite déclarés comme ceci dans le fichier du workflow afin d'être injectés :
steps:
- shell: pwsh
env:
SUPER_SECRET: ${{ secrets.SuperSecret }}
run: |
example-command "$env:SUPER_SECRET"
-
defaut : A activer dans les options
security
->Secret scanning
etpush protection
-
Gitleaks : dans le repartoire du
.git
via la commandegitleaks detect -v