An example WordPress repository with a workflow script that installs Git submodules.
The workflow does the following:
- Checkout the repository
- Tells the checkout task to fetch submodules with
submodules: true
- Provides a personal access token to access the private repo
token: ${{ secrets.REPO_PAT }}
. (see below) - Create a build artifact with name
wpcom
which is required for WordPress.com's GitHub Deployment feature
Note: if you have submodules are in a private repo, you will need to create a personal access token and then save that token as a secret in the repo where the workflow runs.
- Create a classic token here https://github.com/settings/tokens
- Choose
repo
scope
- Choose
- Go to
https://github.com/:account/:repo/settings/secrets/actions
and save the token with a name likeREPO_PAT
. - In your workflow file, include
token: ${{ secrets.REPO_PAT }}
on the checkout action. See here.