You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -603,18 +621,18 @@ The idea is to use the [docker action][action-docker]
603
621
604
622
## Troubleshooting
605
623
606
-
* refusing to allow a GitHub App to create or update workflow `.github/workflows/******.yml` without `workflows` permission
607
-
608
-
This happens because the template repository is trying to overwrite some files inside `.github/workflows/`.
624
+
* The error message `refusing to allow a GitHub App to create or update workflow '.github/workflows/<script-name>.yml' without 'workflows' permission)`
625
+
is indicating that the PAT in the `target_gh_token` does not have the correct permissions.
626
+
This happens because the template repository is trying to overwrite some files inside `.github/workflows/`.
609
627
610
628
Currently `GITHUB_TOKEN` can't be given `workflow` permission.
611
-
You can grant our workflow with `workflows` permission using a PAT following the steps below:
629
+
You can grant our workflow with `workflow` permission using a PAT following the steps below:
612
630
613
-
1. [Create a PAT][github-create-pat] with these repository permissions granted: `contents:write`, `workflows:write`, `metadata:read`.
631
+
1. [Create a PAT][github-create-pat] with these repository permissions granted: `workflow`.
614
632
615
633
2. Copy the generated token and [create a new secret for your target repository][github-create-secret].
616
634
617
-
3. Configure the `checkout` action to use the token in secrets like this:
635
+
3. Configure the `actions-template-sync` step to use the freshly generated token in `target_gh_token` like this:
618
636
619
637
```yaml
620
638
# File: .github/workflows/template-sync.yml
@@ -639,12 +657,12 @@ The idea is to use the [docker action][action-docker]
639
657
uses: actions/checkout@v4
640
658
with:
641
659
# submodules: true
642
-
token: ${{ secrets.<secret_name> }}
643
660
644
661
- name: actions-template-sync
645
662
uses: AndreasAugustin/actions-template-sync@v2
646
663
with:
647
664
source_gh_token: ${{ secrets.GITHUB_TOKEN }}
665
+
target_gh_token: ${{ secrets.<secret_name> }}
648
666
source_repo_path: <owner/repo>
649
667
upstream_branch: <target_branch> # defaults to main
650
668
pr_labels: <label1>,<label2>[,...] # optional, no default
0 commit comments