mirror of
https://github.com/abraunegg/onedrive
synced 2026-03-14 14:35:46 +01:00
Update e2e-personal.yaml
Update yaml
This commit is contained in:
parent
96b2212679
commit
305f420422
1 changed files with 29 additions and 34 deletions
63
.github/workflows/e2e-personal.yaml
vendored
63
.github/workflows/e2e-personal.yaml
vendored
|
|
@ -1,15 +1,10 @@
|
|||
name: E2E Personal Account Testing (push + PR)
|
||||
name: E2E Personal Account Testing (push only)
|
||||
|
||||
on:
|
||||
push:
|
||||
branches-ignore:
|
||||
- master
|
||||
- main
|
||||
pull_request:
|
||||
types:
|
||||
- opened
|
||||
- reopened
|
||||
- synchronize
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
|
@ -74,9 +69,9 @@ jobs:
|
|||
|
||||
pr_comment:
|
||||
name: Post PR summary comment
|
||||
needs: [e2e_personal]
|
||||
needs: [ e2e_personal ]
|
||||
runs-on: ubuntu-latest
|
||||
if: always() && github.event_name == 'pull_request'
|
||||
if: always()
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
|
@ -121,41 +116,41 @@ jobs:
|
|||
echo -e "$md" >> "$GITHUB_OUTPUT"
|
||||
echo "EOF" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Post or update PR comment (sticky)
|
||||
- name: Find PR associated with this commit
|
||||
id: pr
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const { owner, repo } = context.repo;
|
||||
const sha = context.sha;
|
||||
|
||||
const prs = await github.rest.repos.listPullRequestsAssociatedWithCommit({
|
||||
owner, repo, commit_sha: sha
|
||||
});
|
||||
|
||||
if (!prs.data.length) {
|
||||
core.setOutput("found", "false");
|
||||
return;
|
||||
}
|
||||
|
||||
core.setOutput("found", "true");
|
||||
core.setOutput("number", String(prs.data[0].number));
|
||||
|
||||
- name: Post PR comment
|
||||
if: steps.pr.outputs.found == 'true'
|
||||
uses: actions/github-script@v7
|
||||
env:
|
||||
COMMENT_MD: ${{ steps.summary.outputs.md }}
|
||||
with:
|
||||
script: |
|
||||
const { owner, repo } = context.repo;
|
||||
const issue_number = context.payload.pull_request.number;
|
||||
const issue_number = Number("${{ steps.pr.outputs.number }}");
|
||||
|
||||
const marker = "<!-- onedrive-e2e-personal-summary -->";
|
||||
const md = process.env.COMMENT_MD || "⚠️ No summary text produced.";
|
||||
|
||||
const body = `${marker}\n${md}`;
|
||||
|
||||
const comments = await github.rest.issues.listComments({
|
||||
await github.rest.issues.createComment({
|
||||
owner,
|
||||
repo,
|
||||
issue_number,
|
||||
per_page: 100
|
||||
});
|
||||
|
||||
const existing = comments.data.find(c => c.body && c.body.includes(marker));
|
||||
|
||||
if (existing) {
|
||||
await github.rest.issues.updateComment({
|
||||
owner,
|
||||
repo,
|
||||
comment_id: existing.id,
|
||||
body
|
||||
});
|
||||
} else {
|
||||
await github.rest.issues.createComment({
|
||||
owner,
|
||||
repo,
|
||||
issue_number,
|
||||
body
|
||||
});
|
||||
}
|
||||
body: md
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue