Skip to content

TLCE-5323/Add pr-check.yaml workflow#13

Open
tldeployer wants to merge 1 commit into
masterfrom
workflow-update-1753001271
Open

TLCE-5323/Add pr-check.yaml workflow#13
tldeployer wants to merge 1 commit into
masterfrom
workflow-update-1753001271

Conversation

@tldeployer

@tldeployer tldeployer commented Jul 20, 2025

Copy link
Copy Markdown

This PR adds or updates the pr-check.yaml GitHub Actions workflow.

Summary by CodeRabbit

  • Chores
    • Introduced automated checks for Jira issue validation on pull requests via a new workflow.

@tldeployer
tldeployer requested a review from a team as a code owner July 20, 2025 08:47
@coderabbitai

coderabbitai Bot commented Jul 20, 2025

Copy link
Copy Markdown

Walkthrough

A new GitHub Actions workflow file has been added to automate PR checks. This workflow is triggered by pull request events and runs a job that performs Jira-related validation using a third-party action, utilizing GitHub and Jira credentials provided as secrets.

Changes

File(s) Change Summary
.github/workflows/pr-check.yaml Added new workflow for PR Jira validation using a third-party action.

Poem

A workflow hops in, neat and new,
To check each PR as rabbits do.
With secrets tucked and actions swift,
It sniffs for Jira in every lift.
Now every merge will pass the test—
The garden’s code is at its best!
🐇✨

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch workflow-update-1753001271

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai auto-generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Comment on lines +9 to +17
name: PR Jira validation check
runs-on: [ubuntu-latest]
steps:
- name: PR Jira validation check
uses: triplelift-internal/actions/pr-check@v1.0
with:
github_token: '${{ secrets.GH_ORG_TOKEN }}'
jira_user: '${{ secrets.JIRA_USER }}'
jira_token: '${{ secrets.JIRA_TOKEN }}'

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: {}

Copilot Autofix

AI about 1 year ago

To fix this problem, add an explicit permissions key to either the root of the workflow or the specific job. The best practice is to grant only those permissions required for the job to function correctly. For a PR validation check, this typically means granting read access to repository contents (contents: read) and write access to pull-requests (pull-requests: write) if the action needs to leave comments, set PR status, etc. The recommended change is to add the following block to the root of the workflow file, right after the name: (line 1):

permissions:
  contents: read
  pull-requests: write

This 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

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/pr-check.yaml b/.github/workflows/pr-check.yaml
--- a/.github/workflows/pr-check.yaml
+++ b/.github/workflows/pr-check.yaml
@@ -1,3 +1,6 @@
+permissions:
+  contents: read
+  pull-requests: write
 name: PR Checks
 
 on:
EOF
@@ -1,3 +1,6 @@
permissions:
contents: read
pull-requests: write
name: PR Checks

on:
Copilot is powered by AI and may make mistakes. Always verify output.
runs-on: [ubuntu-latest]
steps:
- name: PR Jira validation check
uses: triplelift-internal/actions/pr-check@v1.0

Check warning

Code scanning / CodeQL

Unpinned tag for a non-immutable Action in workflow Medium

Unpinned 3rd party Action 'PR Checks' step
Uses Step
uses 'triplelift-internal/actions/pr-check' with ref 'v1.0', not a pinned commit hash

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
.github/workflows/pr-check.yaml (1)

8-8: Rename the job from “deploy” to something descriptive

deploy is misleading for a validation-only job and can confuse observers and required-check rules. Consider pr-check or jira-validation instead.

-  deploy:
+  pr-check:
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 89ef16d and 0ec02ad.

📒 Files selected for processing (1)
  • .github/workflows/pr-check.yaml (1 hunks)
🧰 Additional context used
🪛 GitHub Check: CodeQL
.github/workflows/pr-check.yaml

[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: {{}}


[warning] 13-13: Unpinned tag for a non-immutable Action in workflow
Unpinned 3rd party Action 'PR Checks' step Uses Step uses 'triplelift-internal/actions/pr-check' with ref 'v1.0', not a pinned commit hash

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Analyze (go)
  • GitHub Check: generate-models

Comment on lines +9 to +11
name: PR Jira validation check
runs-on: [ubuntu-latest]
steps:

Copy link
Copy Markdown

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_TOKEN

The 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 the jobs: 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

Committable suggestion skipped: line range outside the PR's diff.

🧰 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
In .github/workflows/pr-check.yaml around lines 9 to 11, the workflow job lacks
an explicit permissions block, causing it to inherit overly broad default
permissions. Add a minimal permissions block at the jobs level specifying only
the necessary read permissions for the GITHUB_TOKEN, such as 'contents: read',
to enforce least privilege and satisfy CodeQL requirements.

runs-on: [ubuntu-latest]
steps:
- name: PR Jira validation check
uses: triplelift-internal/actions/pr-check@v1.0

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue

Pin the action ref to a commit SHA to mitigate supply-chain risk

Using the mutable tag v1.0 allows upstream changes to silently alter your CI behaviour. Pin the ref to the exact commit SHA (and optionally leave a comment with the tag for readability).

-         uses: triplelift-internal/actions/pr-check@v1.0
+         # v1.0 ⇒ 5b6c1d2 (example)
+         uses: triplelift-internal/actions/pr-check@5b6c1d2fe4a1e9e1b2c3d4e5f67890123456789
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
uses: triplelift-internal/actions/pr-check@v1.0
# v1.0 ⇒ 5b6c1d2 (example)
uses: triplelift-internal/actions/pr-check@5b6c1d2fe4a1e9e1b2c3d4e5f67890123456789
🧰 Tools
🪛 GitHub Check: CodeQL

[warning] 13-13: Unpinned tag for a non-immutable Action in workflow
Unpinned 3rd party Action 'PR Checks' step Uses Step uses 'triplelift-internal/actions/pr-check' with ref 'v1.0', not a pinned commit hash

🤖 Prompt for AI Agents
In .github/workflows/pr-check.yaml at line 13, the action reference uses a
mutable tag 'v1.0' which can lead to unpredictable CI behavior due to upstream
changes. Replace the 'v1.0' tag with the exact commit SHA of the action to pin
the version securely. Optionally, add a comment next to the SHA indicating the
original tag for clarity.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants