This explains and demos how to use diagrams.net (draw.io) diagrams in your GitHub repo.
- See repo for more details
- Diagrams are stored in your repository with your code and docs
- Diagram access is controlled by GitHub repository access
| #!/bin/bash | |
| # The first argument is the username | |
| username=$1 | |
| if [ -z "$username" ]; then | |
| echo "Please provide a username" | |
| exit 1 | |
| fi |
| #!/bin/bash | |
| # This script will add the first 500 open issues of a repository to a ProjectV2 organization project. | |
| set -e | |
| # Only needed the first time | |
| gh auth refresh --scopes project,repo | |
| repository_name='<org>/<repo>' | |
| project_org='<org>' |
| name: CI with in-progress cancellations | |
| on: | |
| pull_request: | |
| branches: [ main ] | |
| workflow_dispatch: | |
| # This is what will cancel the workflow | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} |
| name: Rerun workflow test | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| maxAttempts: | |
| required: true | |
| type: number | |
| default: 3 | |
| rerunFailedOnly: |
| name: Pipeline | |
| stages: | |
| - stage: set_output_variables_stage | |
| displayName: Set output variables | |
| pool: ubuntu-latest | |
| jobs: | |
| - job: set_output_variables_job | |
| displayName: Set output variables | |
| steps: |
| # Sends a reminder to assignees of all open issues in a repo using pwsh | |
| # Uses the built-in GITHUB_TOKEN: https://docs.github.com/en/actions/security-guides/automatic-token-authentication | |
| # Replace the GITHUB_TOKEN environment variable with your own PAT to make the issue comment as yourself | |
| # See example runs: https://github.com/philip-gai/philip-gai/actions/workflows/send_reminders.yml | |
| name: Send Reminders | |
| on: | |
| workflow_dispatch: {} |
| # You have to unset the GITHUB_TOKEN, otherwise gh cli will use it and skip auth | |
| unset GITHUB_TOKEN | |
| # List of scopes: https://docs.github.com/en/developers/apps/building-oauth-apps/scopes-for-oauth-apps#available-scopes | |
| gh auth login --hostname 'github.com' --scopes 'read:org,repo,read:packages' | |
| token="$(gh config get -h github.com oauth_token)" | |
| export GITHUB_TOKEN="$token" |
This explains and demos how to use diagrams.net (draw.io) diagrams in your GitHub repo.
| # Prerequisites: | |
| # - Create a secret with your PAT token. Permissions needed: repo (all) and read:org | |
| # - Create the HELLO_WORLD secret in your environment with some dummy initial value | |
| # | |
| # Notes: | |
| # - You can tell that it works because it masks the secret_body in the echo secret step after it creates the secret 😄 | |
| # - If you don't want to have to pass --repo to gh secret set, then put the actions/checkout@v2 step before the gh secret set step | |
| name: gh-set-secret |