-
Notifications
You must be signed in to change notification settings - Fork 0
TLCE-5323/Add pr-check.yaml workflow #13
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | |||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,17 @@ | |||||||||||||||||||||||
| name: PR Checks | |||||||||||||||||||||||
|
|
|||||||||||||||||||||||
| on: | |||||||||||||||||||||||
| pull_request: | |||||||||||||||||||||||
| types: [opened, edited, reopened, synchronize] | |||||||||||||||||||||||
|
|
|||||||||||||||||||||||
| jobs: | |||||||||||||||||||||||
| deploy: | |||||||||||||||||||||||
| name: PR Jira validation check | |||||||||||||||||||||||
| runs-on: [ubuntu-latest] | |||||||||||||||||||||||
| steps: | |||||||||||||||||||||||
| - name: PR Jira validation check | |||||||||||||||||||||||
| uses: triplelift-internal/actions/pr-check@v1.0 | |||||||||||||||||||||||
Check warningCode scanning / CodeQL Unpinned tag for a non-immutable Action in workflow Medium
Unpinned 3rd party Action 'PR Checks' step
Uses Step Error loading related location Loading There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Pin the action ref to a commit SHA to mitigate supply-chain risk Using the mutable tag - uses: triplelift-internal/actions/pr-check@v1.0
+ # v1.0 ⇒ 5b6c1d2 (example)
+ uses: triplelift-internal/actions/pr-check@5b6c1d2fe4a1e9e1b2c3d4e5f67890123456789📝 Committable suggestion
Suggested change
🧰 Tools🪛 GitHub Check: CodeQL[warning] 13-13: Unpinned tag for a non-immutable Action in workflow 🤖 Prompt for AI Agents |
|||||||||||||||||||||||
| with: | |||||||||||||||||||||||
| github_token: '${{ secrets.GH_ORG_TOKEN }}' | |||||||||||||||||||||||
| jira_user: '${{ secrets.JIRA_USER }}' | |||||||||||||||||||||||
| jira_token: '${{ secrets.JIRA_TOKEN }}' | |||||||||||||||||||||||
|
Comment on lines
+9
to
+17
Check warningCode 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: {}
Copilot AutofixAI about 1 year ago To fix this problem, add an explicit permissions:
contents: read
pull-requests: writeThis will ensure all jobs inherit these restricted permissions unless overridden. No additional imports or definitions are required.
Suggested changeset
1
.github/workflows/pr-check.yaml
Copilot is powered by AI and may make mistakes. Always verify output.
Refresh and try again.
|
|||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Add an explicit
permissions:block for least-privilege GITHUB_TOKENThe job currently inherits the default (
contents: read, write to everything else), which is broader than needed for a read-only validation action. Add a minimal permissions stanza right under thejobs:level to satisfy CodeQL and harden the workflow.deploy: name: PR Jira validation check + permissions: + pull-requests: read + contents: read + issues: read runs-on: ubuntu-latest🧰 Tools
🪛 GitHub Check: CodeQL
[warning] 9-17: Workflow does not contain permissions
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: {{}}
🤖 Prompt for AI Agents