Exclusions

Report a typo

We can use wildcard patterns to specify paths to upload in a workflow. We can also exclude some files/folders. Picture the following folder structure for a simple Django web app. You do not need to be a Django developer to understand the logic:

.github
├── workflows
    └── using_wildcards.yml
myapp
├── __init__.py
└── models.py
    ├──...
myproj
├── __init__.py
└── settings.py
└── log.log
    ├──...
env
├── Include
    └── django
        └── contrib
            ├──...
    ├──...

The uploaded artifacts will be deployed to the cloud, but not everyone is invited to the party:

- name: Upload build artifacts
  uses: actions/upload-artifact@v3
  with:
    name: build
    path: |
      ./*
      ./myapp/*
      !./env/*
      ./myproj/**
      !./myproj/**/*.log
      !./.github/**

Tick appropriately to indicate whether files/folders would be included or excluded.

Choose one option for each row
IncludedExcluded
Any file in the myproj directory that has a .log file extension
All files and folders from the current working directory
The .github folder and all its contents
All files and folders in the env directory
All files and folders in the myapp directory
___

Create a free account to access the full topic