-
Notifications
You must be signed in to change notification settings - Fork 1
.github/workflows: add check-tidy #26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 | ||
|
||
- name: Install Nix | ||
uses: cachix/install-nix-action@02a151ada4993995686f9ed4f1be7cfbb229e56f # v31 | ||
with: | ||
nix_path: nixpkgs=channel:nixos-unstable | ||
|
||
- name: Ensure modules are tidy | ||
run: | | ||
nix develop -c go run github.com/jmank88/[email protected] tidy | ||
git add --all | ||
git diff --minimal --cached --exit-code | ||
- name: Ensure mockery has been run | ||
run: | | ||
nix develop -c grep -rl "^// Code generated by mockery" | grep .go$ | xargs -r rm | ||
nix develop -c go run github.com/jmank88/[email protected] -go generate ./... | ||
git add --all | ||
git diff --stat --cached --exit-code |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 2 months ago
To fix the problem, add a permissions
block to the workflow file .github/workflows/relayer-build.yml
. The block should be placed at the top level (before jobs:
) to apply to all jobs, unless a job requires different permissions. Based on the workflow, none of the jobs appear to require write access to repository contents, so the minimal starting point is contents: read
. If in the future a job needs additional permissions (e.g., to create pull requests or write to issues), those can be added at the job level. The change involves inserting the following block after the name:
and before the on:
section:
permissions:
contents: read
No additional imports, methods, or definitions are required.
-
Copy modified lines R3-R5
@@ -1,5 +1,8 @@ | ||
name: TRON - Relayer | ||
|
||
permissions: | ||
contents: read | ||
|
||
on: | ||
push: | ||
branches: |
https://smartcontract-it.atlassian.net/browse/CRE-710
Related: