Skip to content

🔄 Synced file(s) with ottrproject/OTTR_Template#2

Open
jhudsl-robot wants to merge 7 commits intomainfrom
repo-sync/OTTR_Template/default
Open

🔄 Synced file(s) with ottrproject/OTTR_Template#2
jhudsl-robot wants to merge 7 commits intomainfrom
repo-sync/OTTR_Template/default

Conversation

@jhudsl-robot
Copy link
Contributor

Synced local file(s) with ottrproject/OTTR_Template.

Changed files
  • Synced local config_automation.yml with remote config_automation.yml
  • Synced local .github/workflows/send-updates.yml with remote .github/workflows/send-updates.yml
  • Synced local .github/workflows/test-send-updates.yml with remote .github/workflows/test-send-updates.yml
  • Synced local .github/switch_sync_repo.R with remote .github/switch_sync_repo.R

This PR was created automatically by the repo-file-sync-action workflow run #15498355326

jhudsl-robot added 4 commits June 6, 2025 19:39
@jhudsl-robot
Copy link
Contributor Author

Please carefully review these changes and decide which are useful for your course.
See the release notes: https://github.com/jhudsl/OTTR_Template/releases

  • If you don't want the changes from a particular file, you can always revert that particular commit before merging the sync PR.
    If you will not want any updates on this file in the future, you may want to remove a file from being synced in your repo by reconfiguring the sync file.

  • If you want only some changes, but they are not on a whole file basis, you could check out the branch and make manual edits. To checkout the branch, navigate to your own repository you should be able to run:

git checkout repo-sync/OTTR_Template/default
  • If you don't want any of the changes you can close the PR entirely.

You may want to unenroll your repository from the sync GitHub actions by filing a PR on OTTR_Template
to delete your repo name from this file if this will continue to be the case.

Updated the pull request workflow configuration to match with new OTTR
Comment on lines +89 to +114
name: Style code
needs: yaml-check
if: ${{needs.yaml-check.outputs.toggle_url_check == 'yes'}}
uses: jhudsl/ottr-reports/.github/workflows/report-maker.yml@main
with:
check_type: urls
error_min: 0
gh_pat: secrets.GH_PAT

quiz-check:
name: Check quiz formatting
if: ${{needs.yaml-check.outputs.toggle_quiz_check == 'yes'}}
runs-on: ubuntu-latest
if: ${{needs.yaml-check.outputs.toggle_style_code == 'true'}}
container:
image: jhudsl/base_ottr:main

steps:
- name: Checkout files
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Run styler
run: Rscript -e "styler::style_file(list.files(pattern = '(R|q)md$', recursive = FALSE, full.names = TRUE));warnings()"

- name: Commit styled files
run: |
git config --system --add safe.directory "$GITHUB_WORKSPACE"
git add \*md
git commit -m 'Style *mds' || echo "No changes to commit"
git push origin || echo "No changes to commit"

############################# Readability Report ###################################

readability-report:

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 about 1 month ago

To fix the problem, add an explicit permissions block that grants only the minimal scopes required. In this case, the style-code job must push commits back to the repository, so it needs contents: write. It does not appear to need any other scopes (no issues, PRs, workflows, etc.), so contents: write alone is sufficient.

The best change with minimal impact is to add a job-level permissions block under the style-code job definition, similar to what is already done for the ottr-reports job. This keeps other jobs unaffected and clearly documents that only this job needs write access to repository contents. No imports or additional definitions are needed because this is purely a YAML configuration change.

Concretely:

  • Edit .github/workflows/pull_request.yml.
  • In the style-code job (lines 88–105), insert:
    permissions:
      contents: write
  • Place it after needs: yaml-check (or before runs-on:) so indentation and structure are consistent with the ottr-reports job’s existing permissions block.
Suggested changeset 1
.github/workflows/pull_request.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/pull_request.yml b/.github/workflows/pull_request.yml
--- a/.github/workflows/pull_request.yml
+++ b/.github/workflows/pull_request.yml
@@ -88,6 +88,8 @@
   style-code:
     name: Style code
     needs: yaml-check
+    permissions:
+      contents: write
     runs-on: ubuntu-latest
     if: ${{needs.yaml-check.outputs.toggle_style_code == 'true'}}
     container:
EOF
@@ -88,6 +88,8 @@
style-code:
name: Style code
needs: yaml-check
permissions:
contents: write
runs-on: ubuntu-latest
if: ${{needs.yaml-check.outputs.toggle_style_code == 'true'}}
container:
Copilot is powered by AI and may make mistakes. Always verify output.
Comment on lines +115 to +130
name: Readability report
needs: yaml-check
uses: jhudsl/ottr-reports/.github/workflows/report-maker.yml@main
with:
check_type: quiz_format
error_min: 0
gh_pat: secrets.GH_PAT
runs-on: ubuntu-latest
if: ${{needs.yaml-check.outputs.toggle_readability == 'true'}}

steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Readability report
uses: Rebilly/lexi@v2
with:
github-token: ${{ secrets.GH_PAT }}
glob: '**/*.md'

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 about 1 month ago

In general, to fix this class of problem you add an explicit permissions: block either at the workflow root (applies to all jobs without their own permissions) or on the specific job that should have restricted permissions, and set only the scopes actually needed (often just contents: read).

For this workflow, there is already a permissions block on the ottr-reports job (with pull-requests: write), so we should not override that at the root. Instead, we will add a job-level permissions: block to the readability-report job so that its GITHUB_TOKEN is limited to read-only. The job checks out the repository and runs Rebilly/lexi@v2 with a github-token input; for analyzing files and posting results via the provided token, read access to repository contents is sufficient. Therefore, we will add:

    permissions:
      contents: read

immediately under runs-on: ubuntu-latest (line 117) in the readability-report job. No imports or other code changes are required.

Suggested changeset 1
.github/workflows/pull_request.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/pull_request.yml b/.github/workflows/pull_request.yml
--- a/.github/workflows/pull_request.yml
+++ b/.github/workflows/pull_request.yml
@@ -115,6 +115,8 @@
     name: Readability report
     needs: yaml-check
     runs-on: ubuntu-latest
+    permissions:
+      contents: read
     if: ${{needs.yaml-check.outputs.toggle_readability == 'true'}}
 
     steps:
EOF
@@ -115,6 +115,8 @@
name: Readability report
needs: yaml-check
runs-on: ubuntu-latest
permissions:
contents: read
if: ${{needs.yaml-check.outputs.toggle_readability == 'true'}}

steps:
Copilot is powered by AI and may make mistakes. Always verify output.
@kweav
Copy link
Contributor

kweav commented Feb 20, 2026

Need to resolve conflicts and update render-both workflow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants