Skip to content

Conversation

@CLHatch
Copy link
Contributor

@CLHatch CLHatch commented Jan 6, 2026

Adds a workflow to auto-sync .apps and docs/apps to DockSTARTer-Templates on push.

@CLHatch CLHatch requested review from a team as code owners January 6, 2026 19:02
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, we are unable to review this pull request

The GitHub API does not allow us to fetch diffs exceeding 20000 lines

@github-actions github-actions bot added ci Automatic label core Automatic label repo Automatic label labels Jan 6, 2026
Comment on lines +15 to +26
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Sync Files
uses: BetaHuhn/repo-file-sync-action@v1
with:
GH_PAT: ${{ secrets.GH_PAT }}
CONFIG_PATH: .github/sync.yml
PR_LABELS: sync
COMMIT_PREFIX: "chore: sync from DockSTARTer"

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

Copilot Autofix

AI 22 days ago

In general, fix this by adding a permissions: block that explicitly restricts the default GITHUB_TOKEN permissions to the minimal scopes needed. This can be done at the workflow root (applies to all jobs without their own permissions) or at the job level. Since there is only one job (sync), adding permissions: under that job is clear and localized.

The BetaHuhn/repo-file-sync-action typically needs to push changes and/or open PRs in target repositories. That requires at least contents: write and pull-requests: write on GITHUB_TOKEN if it uses that token. However, this workflow passes a PAT via GH_PAT, which the action uses for cross‑repo operations. The GITHUB_TOKEN is still used implicitly by Actions for some operations (e.g., commenting on PRs in this repo, if configured). To remain safe while preserving functionality, we can grant contents: read globally and only what’s obviously needed as write. For a conservative, least‑privilege configuration that still supports repo‑file‑sync’s typical workflow of creating commits and PRs, define:

permissions:
  contents: write
  pull-requests: write

Insert this under jobs: sync: on line 15, just before runs-on. No imports or external definitions are needed—only the YAML change in .github/workflows/sync_templates.yml.

Suggested changeset 1
.github/workflows/sync_templates.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/sync_templates.yml b/.github/workflows/sync_templates.yml
--- a/.github/workflows/sync_templates.yml
+++ b/.github/workflows/sync_templates.yml
@@ -12,6 +12,9 @@
 
 jobs:
   sync:
+    permissions:
+      contents: write
+      pull-requests: write
     runs-on: ubuntu-latest
     steps:
       - name: Checkout
EOF
@@ -12,6 +12,9 @@

jobs:
sync:
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- name: Checkout
Copilot is powered by AI and may make mistakes. Always verify output.
uses: actions/checkout@v4

- name: Sync Files
uses: BetaHuhn/repo-file-sync-action@v1

Check warning

Code scanning / CodeQL

Unpinned tag for a non-immutable Action in workflow Medium

Unpinned 3rd party Action 'Sync to Templates' step
Uses Step
uses 'BetaHuhn/repo-file-sync-action' with ref 'v1', not a pinned commit hash
@CLHatch CLHatch closed this Jan 6, 2026
@CLHatch CLHatch deleted the feature/sync-workflow branch January 6, 2026 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Automatic label core Automatic label repo Automatic label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants