mirror of
https://github.com/Stirling-Tools/Stirling-PDF.git
synced 2025-06-06 18:30:57 +00:00
Merge branch 'main' into 3319-bug-cosmetic---design-of-languages-selector
This commit is contained in:
commit
1be689e068
64
.github/workflows/PR-Demo-Comment-with-react.yml
vendored
64
.github/workflows/PR-Demo-Comment-with-react.yml
vendored
@ -6,13 +6,12 @@ on:
|
|||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
issues: write # Required for adding reactions to comments
|
||||||
|
pull-requests: read # Required for reading PR information
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
check-comment:
|
check-comment:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
|
||||||
pull-requests: read
|
|
||||||
issues: read
|
|
||||||
if: |
|
if: |
|
||||||
github.event.issue.pull_request &&
|
github.event.issue.pull_request &&
|
||||||
(
|
(
|
||||||
@ -75,24 +74,31 @@ jobs:
|
|||||||
core.setOutput('ref', pr.head.ref);
|
core.setOutput('ref', pr.head.ref);
|
||||||
|
|
||||||
- name: Add 'in_progress' reaction to comment
|
- name: Add 'in_progress' reaction to comment
|
||||||
|
id: add-eyes-reaction
|
||||||
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
|
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
|
||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
const { owner, repo } = context.repo;
|
console.log(`Adding eyes reaction to comment ID: ${context.payload.comment.id}`);
|
||||||
const commentId = context.payload.comment.id;
|
try {
|
||||||
|
const { data: reaction } = await github.rest.reactions.createForIssueComment({
|
||||||
await github.rest.reactions.createForIssueComment({
|
owner: context.repo.owner,
|
||||||
owner,
|
repo: context.repo.repo,
|
||||||
repo,
|
comment_id: context.payload.comment.id,
|
||||||
comment_id: commentId,
|
|
||||||
content: 'eyes'
|
content: 'eyes'
|
||||||
});
|
});
|
||||||
|
console.log(`Added reaction with ID: ${reaction.id}`);
|
||||||
|
return { success: true, id: reaction.id };
|
||||||
|
} catch (error) {
|
||||||
|
console.error(`Failed to add reaction: ${error.message}`);
|
||||||
|
console.error(error);
|
||||||
|
return { success: false, error: error.message };
|
||||||
|
}
|
||||||
|
|
||||||
deploy-pr:
|
deploy-pr:
|
||||||
needs: check-comment
|
needs: check-comment
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
pull-requests: write
|
contents: read
|
||||||
issues: write
|
issues: write
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
@ -201,30 +207,38 @@ jobs:
|
|||||||
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
|
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
|
||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
const { owner, repo } = context.repo;
|
console.log(`Adding rocket reaction to comment ID: ${{ needs.check-comment.outputs.comment_id }}`);
|
||||||
const commentId = ${{ needs.check-comment.outputs.comment_id }};
|
try {
|
||||||
|
const { data: reaction } = await github.rest.reactions.createForIssueComment({
|
||||||
await github.rest.reactions.createForIssueComment({
|
owner: context.repo.owner,
|
||||||
owner,
|
repo: context.repo.repo,
|
||||||
repo,
|
comment_id: ${{ needs.check-comment.outputs.comment_id }},
|
||||||
comment_id: commentId,
|
|
||||||
content: 'rocket'
|
content: 'rocket'
|
||||||
});
|
});
|
||||||
|
console.log(`Added rocket reaction with ID: ${reaction.id}`);
|
||||||
|
} catch (error) {
|
||||||
|
console.error(`Failed to add reaction: ${error.message}`);
|
||||||
|
console.error(error);
|
||||||
|
}
|
||||||
|
|
||||||
- name: Add failure reaction to comment
|
- name: Add failure reaction to comment
|
||||||
if: failure()
|
if: failure()
|
||||||
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
|
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
|
||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
const { owner, repo } = context.repo;
|
console.log(`Adding -1 reaction to comment ID: ${{ needs.check-comment.outputs.comment_id }}`);
|
||||||
const commentId = ${{ needs.check-comment.outputs.comment_id }};
|
try {
|
||||||
|
const { data: reaction } = await github.rest.reactions.createForIssueComment({
|
||||||
await github.rest.reactions.createForIssueComment({
|
owner: context.repo.owner,
|
||||||
owner,
|
repo: context.repo.repo,
|
||||||
repo,
|
comment_id: ${{ needs.check-comment.outputs.comment_id }},
|
||||||
comment_id: commentId,
|
|
||||||
content: '-1'
|
content: '-1'
|
||||||
});
|
});
|
||||||
|
console.log(`Added -1 reaction with ID: ${reaction.id}`);
|
||||||
|
} catch (error) {
|
||||||
|
console.error(`Failed to add reaction: ${error.message}`);
|
||||||
|
console.error(error);
|
||||||
|
}
|
||||||
|
|
||||||
- name: Post deployment URL to PR
|
- name: Post deployment URL to PR
|
||||||
if: success()
|
if: success()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user