mirror of
https://github.com/arsvendg/Stirling-PDF.git
synced 2026-07-16 19:33:11 +02:00
ci(workflow): simplify PR deployment by removing redundant repo/ref lookup (#4266)
# Description of Changes
- Removed the separate step that fetched PR repository and ref
(`get-pr-info`).
- Simplified checkout by directly using `refs/pull/${{
needs.check-comment.outputs.pr_number }}/merge`.
- This reduces workflow complexity and avoids unnecessary API calls
while still supporting forked PRs.
---
## Checklist
### General
- [x] I have read the [Contribution
Guidelines](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/CONTRIBUTING.md)
- [x] I have read the [Stirling-PDF Developer
Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/DeveloperGuide.md)
(if applicable)
- [ ] I have read the [How to add new languages to
Stirling-PDF](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/HowToAddNewLanguage.md)
(if applicable)
- [ ] I have performed a self-review of my own code
- [x] My changes generate no new warnings
### Documentation
- [ ] I have updated relevant docs on [Stirling-PDF's doc
repo](https://github.com/Stirling-Tools/Stirling-Tools.github.io/blob/main/docs/)
(if functionality has heavily changed)
- [ ] I have read the section [Add New Translation
Tags](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/HowToAddNewLanguage.md#add-new-translation-tags)
(for new translation tags only)
### UI Changes (if applicable)
- [ ] Screenshots or videos demonstrating the UI changes are attached
(e.g., as comments or direct attachments in the PR)
### Testing (if applicable)
- [ ] I have tested my changes locally. Refer to the [Testing
Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/DeveloperGuide.md#6-testing)
for more details.
This commit is contained in:
@@ -33,8 +33,6 @@ jobs:
|
|||||||
)
|
)
|
||||||
outputs:
|
outputs:
|
||||||
pr_number: ${{ steps.get-pr.outputs.pr_number }}
|
pr_number: ${{ steps.get-pr.outputs.pr_number }}
|
||||||
pr_repository: ${{ steps.get-pr-info.outputs.repository }}
|
|
||||||
pr_ref: ${{ steps.get-pr-info.outputs.ref }}
|
|
||||||
comment_id: ${{ github.event.comment.id }}
|
comment_id: ${{ github.event.comment.id }}
|
||||||
disable_security: ${{ steps.check-security-flag.outputs.disable_security }}
|
disable_security: ${{ steps.check-security-flag.outputs.disable_security }}
|
||||||
enable_pro: ${{ steps.check-pro-flag.outputs.enable_pro }}
|
enable_pro: ${{ steps.check-pro-flag.outputs.enable_pro }}
|
||||||
@@ -66,29 +64,6 @@ jobs:
|
|||||||
console.log(`PR Number: ${prNumber}`);
|
console.log(`PR Number: ${prNumber}`);
|
||||||
core.setOutput('pr_number', prNumber);
|
core.setOutput('pr_number', prNumber);
|
||||||
|
|
||||||
- name: Get PR repository and ref
|
|
||||||
id: get-pr-info
|
|
||||||
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
|
|
||||||
with:
|
|
||||||
script: |
|
|
||||||
const { owner, repo } = context.repo;
|
|
||||||
const prNumber = context.payload.issue.number;
|
|
||||||
|
|
||||||
const { data: pr } = await github.rest.pulls.get({
|
|
||||||
owner,
|
|
||||||
repo,
|
|
||||||
pull_number: prNumber,
|
|
||||||
});
|
|
||||||
|
|
||||||
// For forks, use the full repository name, for internal PRs use the current repo
|
|
||||||
const repository = pr.head.repo.fork ? pr.head.repo.full_name : `${owner}/${repo}`;
|
|
||||||
|
|
||||||
console.log(`PR Repository: ${repository}`);
|
|
||||||
console.log(`PR Branch: ${pr.head.ref}`);
|
|
||||||
|
|
||||||
core.setOutput('repository', repository);
|
|
||||||
core.setOutput('ref', pr.head.ref);
|
|
||||||
|
|
||||||
- name: Check for security/login flag
|
- name: Check for security/login flag
|
||||||
id: check-security-flag
|
id: check-security-flag
|
||||||
env:
|
env:
|
||||||
@@ -171,8 +146,7 @@ jobs:
|
|||||||
- name: Checkout PR
|
- name: Checkout PR
|
||||||
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
|
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
|
||||||
with:
|
with:
|
||||||
repository: ${{ needs.check-comment.outputs.pr_repository }}
|
ref: refs/pull/${{ needs.check-comment.outputs.pr_number }}/merge
|
||||||
ref: ${{ needs.check-comment.outputs.pr_ref }}
|
|
||||||
token: ${{ steps.setup-bot.outputs.token }}
|
token: ${{ steps.setup-bot.outputs.token }}
|
||||||
|
|
||||||
- name: Set up JDK
|
- name: Set up JDK
|
||||||
|
|||||||
Reference in New Issue
Block a user